From 57bb99edd45767d071838306c9bcc39eafe3f9ef Mon Sep 17 00:00:00 2001 From: Jake Dallimore Date: Fri, 18 Sep 2020 17:24:40 +0800 Subject: [PATCH] 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. --- repository/googledocs/lib.php | 2 +- repository/nextcloud/lib.php | 2 +- repository/onedrive/lib.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/repository/googledocs/lib.php b/repository/googledocs/lib.php index 88e5c9a3f3c..0f62e8ea65c 100644 --- a/repository/googledocs/lib.php +++ b/repository/googledocs/lib.php @@ -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; } diff --git a/repository/nextcloud/lib.php b/repository/nextcloud/lib.php index e2ad61f27c7..62f38c0a1e4 100644 --- a/repository/nextcloud/lib.php +++ b/repository/nextcloud/lib.php @@ -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; } diff --git a/repository/onedrive/lib.php b/repository/onedrive/lib.php index f03c8dcaa30..b2c6d807b2f 100644 --- a/repository/onedrive/lib.php +++ b/repository/onedrive/lib.php @@ -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; }