Merge branch 'MDL-70430-master-oauth2refreshtoken' of git://github.com/mudrd8mz/moodle
authorEloy Lafuente (stronk7) <stronk7@moodle.org>
Mon, 21 Dec 2020 23:06:32 +0000 (00:06 +0100)
committerEloy Lafuente (stronk7) <stronk7@moodle.org>
Mon, 21 Dec 2020 23:06:32 +0000 (00:06 +0100)
lib/classes/oauth2/client.php

index 574ea94..6c49aaa 100644 (file)
@@ -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();
         }