Skip to content

Commit

Permalink
MDL-70430 oauth2: Fix storing of the new refresh token
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mudrd8mz committed Dec 8, 2020
1 parent f34b446 commit 16d8706
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/classes/oauth2/client.php
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ public function upgrade_refresh_token(system_account $systemaccount) {

// 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();
}
Expand Down

0 comments on commit 16d8706

Please sign in to comment.