From 16d8706e2e681d6606ce891d6baee61c68d798f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Mudr=C3=A1k?= Date: Tue, 8 Dec 2020 11:20:14 +0100 Subject: [PATCH] MDL-70430 oauth2: Fix storing of the new refresh token 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. --- lib/classes/oauth2/client.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/classes/oauth2/client.php b/lib/classes/oauth2/client.php index 574ea943438..6c49aaaa67c 100644 --- a/lib/classes/oauth2/client.php +++ b/lib/classes/oauth2/client.php @@ -473,7 +473,7 @@ class client extends \oauth2_client { // 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(); }