Closed scr4bble closed 3 years ago
Update. I just found out that in some cases the access token is indeed automatically fetched when invalid. But the mail-sending method still raises exception.
I might have found the problem in the code. I will just learn how to do the pull request here and I will try to post it :) Please review and include into live branch as soon as you can.
Fixed by #280
We are getting this error: AuthenticationException: Invalid Credentials in ...vendor/helpscout/api/src/Http/Handlers/AuthenticationHandler.php:19
We are not 100% sure why it happens that tokens sometimes become invalid. In any case - I think that client should try to fetch correct access token if it has refresh token present and valid.
This is how Client is initialized:
Current behavior If there is wrong access token entered into the client, next method that is using API will fail with AuthenticationException: Invalid Credentials.
Expected behavior Could the client instead try to fetch new access token using the provided refresh token? And then only fails with authentication error if also refresh token is invalid.
Steps to reproduce
..