Unverified Commit 99e632c4 authored by Jan Dageförde's avatar Jan Dageförde
Browse files

MDL-59889 oauth2: Remove check for storing new refresh token

parent d8e9a23c
......@@ -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;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment