There was a typo - missing underscore. As a result, the new refresh
token was never updated in the database. Depending on the issuer and
whether or when theyu invalidate issued refresh tokens, this might or
might not make the token refresh stop working.
// Store the access token and, if provided by the server, the new refresh token.
$this->store_token($receivedtokens['access_token']);
- if (isset($receivedtokens['refreshtoken'])) {
+ if (isset($receivedtokens['refresh_token'])) {
$systemaccount->set('refreshtoken', $receivedtokens['refresh_token']->token);
$systemaccount->update();
}