Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactored StoreTokenAction #78

Open
twocngdagz opened this issue Nov 22, 2024 · 0 comments
Open

Refactored StoreTokenAction #78

twocngdagz opened this issue Nov 22, 2024 · 0 comments

Comments

@twocngdagz
Copy link

twocngdagz commented Nov 22, 2024

Hi @dcblogdev

When you refactor to use this action, you inadvertently introduce a bug

if ($tenantId) {
    $where = ['tenant_id' => $tenantId];
} elseif ($tenantData !== []) {
    $data = array_merge($data, $tenantData);
    $where = ['tenant_id' => $data['tenant_id']];
} else {
    $where = ['id' => 1];
}

if $tenantId is set, then the $data does not get merged with $tenantData which contains all tenant information.
Therefore tenant name will not be set in the Xero token model. These will happen the first time the authentication redirects back to the app.

Which will throw this error after authentication
Dcblogdev\Xero\Xero::getTenantName(): Return value must be of type string, null returned

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant