Skip to content

Conversation

@afoster
Copy link
Contributor

@afoster afoster commented Feb 20, 2025

Hi Webfox team 👋

This PR is perhaps more of a question than a hard proposal because I'm confused how it works in its current state, leading me to assume I'm doing something very wrong actually using the library.

With the id_token instance variable defined as an array I get the error on the Xero authorization callback.

Cannot assign string to property Webfox\Xero\Events\XeroAuthorized::$id_token of type array

If I inspect the data fed into the XeroAuthorized event (from $oauth->getData()) the id_token is in fact a string; and looking at the OauthCredentialManager.php it seems to be treated as a string throughout.

I am currently using the FileStore; the CacheStore is consistent.

Any suggestions welcome. Thanks

@JamesFreeman
Copy link
Collaborator

This change makes sense to me. Not sure where I got the array from tbh...

@afoster Could you change the test here to reflect this change

@afoster
Copy link
Contributor Author

afoster commented Feb 24, 2025

I've updated the tests, though again, it's interesting they were originally written to expect an array. The Xero docs say the id_token should be a JWT string, and can't find any reference to that changing recently..

@hailwood
Copy link
Contributor

Hey all,

This looks good to me. After researching I also cannot find anywhere the token is referred to as anything other than a string.

I wonder if we were originally decoding the token and we've got confused that way.

Either way I'll merge this and cut a release :)

Thanks @afoster!

@hailwood hailwood merged commit c21ae0c into foxbytehq:master Feb 25, 2025
1 check passed
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

Successfully merging this pull request may close these issues.

3 participants