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
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: