MDL-59510 core_oauth2: autorefresh google drive, nextcloud and onedrive

Request additional offline access, allowing the repository to sign in
automatically each time, including across different user sessions, until
either the refresh token is invalidated or the user logs out of the
repository.
This commit is contained in:
Jake Dallimore 2020-09-18 17:24:40 +08:00
parent f5046a5a1d
commit 255a910c92
3 changed files with 3 additions and 3 deletions

View File

@ -97,7 +97,7 @@ class repository_googledocs extends repository {
$returnurl->param('sesskey', sesskey());
}
$this->client = \core\oauth2\api::get_user_oauth_client($this->issuer, $returnurl, self::SCOPES);
$this->client = \core\oauth2\api::get_user_oauth_client($this->issuer, $returnurl, self::SCOPES, true);
return $this->client;
}

View File

@ -574,7 +574,7 @@ class repository_nextcloud extends repository {
$returnurl->param('repo_id', $this->id);
$returnurl->param('sesskey', sesskey());
}
$this->client = \core\oauth2\api::get_user_oauth_client($this->issuer, $returnurl, self::SCOPES);
$this->client = \core\oauth2\api::get_user_oauth_client($this->issuer, $returnurl, self::SCOPES, true);
return $this->client;
}

View File

@ -93,7 +93,7 @@ class repository_onedrive extends repository {
$returnurl->param('sesskey', sesskey());
}
$this->client = \core\oauth2\api::get_user_oauth_client($this->issuer, $returnurl, self::SCOPES);
$this->client = \core\oauth2\api::get_user_oauth_client($this->issuer, $returnurl, self::SCOPES, true);
return $this->client;
}