mirror of
https://github.com/moodle/moodle.git
synced 2025-04-22 17:02:03 +02:00
MDL-59889 oauth2: Remove check for storing new refresh token
This commit is contained in:
parent
d8e9a23c48
commit
99e632c446
@ -215,15 +215,9 @@ class client extends \oauth2_client {
|
||||
$this->store_token($accesstoken);
|
||||
|
||||
if (isset($r->refresh_token)) {
|
||||
$userinfo = $this->get_userinfo();
|
||||
|
||||
if ($userinfo['email'] == $systemaccount->get('email')) {
|
||||
$systemaccount->set('refreshtoken', $r->refresh_token);
|
||||
$systemaccount->update();
|
||||
$this->refreshtoken = $r->refresh_token;
|
||||
} else {
|
||||
throw new moodle_exception('Attempt to store refresh token for non-system user.');
|
||||
}
|
||||
$systemaccount->set('refreshtoken', $r->refresh_token);
|
||||
$systemaccount->update();
|
||||
$this->refreshtoken = $r->refresh_token;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user