Closed bgilly1 closed 3 years ago
Thanks @bgilly1 - I had suspected that the refresh token was always being used when the bearer token should be valid. I shall look into this over the coming days and extend the test cases once I have identified the solution. Thanks for tracing the code to this block.
That code is totally borked. It's stomping the access_token instead of returning the scopes.
It's fixed on my rabbiveesh/service_account branch, which i hope to merge soon
This is fixed on CPAN in version 0.23
I noticed that every time I call the API, the token was getting refreshed. I enabled MOJO_USERAGENT_DEBUG and determined the Bearer value in the header initally sent was an "ARRAY(XXXXX)" value.
I believe this code in Credentials.pm is the issue.
Perhaps this scopes array should be returned to a different attribute like
$self->scopes
?