upwork / php-upwork-oauth2

PHP bindings for Upwork API (OAuth2)
Apache License 2.0
10 stars 6 forks source link

Refresh token not updated when doing ?grant_type=refresh_token flow #21

Closed viperet closed 2 months ago

viperet commented 3 months ago

When getting a new access_token using the Refresh Token flow, Upwork returns a valid access_token plus an updated refresh_token. The old refresh_token is still valid but expires in 1-2 days. To work correctly beyond this period, the library should update refresh_token each time a new access_token is requested. Currently, after 1-2 days, it stops working with an error:

Fatal error:  Uncaught League\OAuth2\Client\Provider\Exception\IdentityProviderException: invalid_grant in /var/www/foobar/vendor/league/oauth2-client/src/Provider/GenericProvider.php:236
mnovozhylov commented 2 months ago

Fixed in v2.4.3