mirror of
https://github.com/moodle/moodle.git
synced 2025-03-14 12:40:01 +01:00
MDL-52051 oauth: expires_in is optional
This commit is contained in:
parent
d9520bc04e
commit
3a4c497c15
@ -517,7 +517,10 @@ abstract class oauth2_client extends curl {
|
||||
// Store the token an expiry time.
|
||||
$accesstoken = new stdClass;
|
||||
$accesstoken->token = $r->access_token;
|
||||
$accesstoken->expires = (time() + ($r->expires_in - 10)); // Expires 10 seconds before actual expiry.
|
||||
if (isset($r->expires_in)) {
|
||||
// Expires 10 seconds before actual expiry.
|
||||
$accesstoken->expires = (time() + ($r->expires_in - 10));
|
||||
}
|
||||
$this->store_token($accesstoken);
|
||||
|
||||
return true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user