Skip to content

Commit

Permalink
MDL-59510 core_oauth2: autorefresh google drive, nextcloud and onedrive
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
snake committed Oct 5, 2020
1 parent f5046a5 commit 255a910
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion repository/googledocs/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ protected function get_user_oauth_client($overrideurl = false) {
$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;
}
Expand Down
2 changes: 1 addition & 1 deletion repository/nextcloud/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ protected function get_user_oauth_client($overrideurl = false) {
$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;
}

Expand Down
2 changes: 1 addition & 1 deletion repository/onedrive/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ protected function get_user_oauth_client($overrideurl = false) {
$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;
}
Expand Down

0 comments on commit 255a910

Please sign in to comment.