aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_external/ajax
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2015-11-06 12:35:28 +0100
committerVincent Petry <pvince81@owncloud.com>2015-11-06 13:56:37 +0100
commit26b01c7fffa619fa508057656bd90a30f39c1bcc (patch)
tree7360c623798f4d42eaedd481174d08c9366dc48f /apps/files_external/ajax
parent6e7411fc4c6cf8f05d9937bcf112728285a42f50 (diff)
downloadnextcloud-server-26b01c7fffa619fa508057656bd90a30f39c1bcc.tar.gz
nextcloud-server-26b01c7fffa619fa508057656bd90a30f39c1bcc.zip
Force approval in GDrive oauth to get refresh_token
Forcing the approval of app permissions makes sure that the GDrive API will always return a refresh_token. In the case of apps that were already authorized for the current user/domain, the API doesn't return the refresh_token which causes expiration issues.
Diffstat (limited to 'apps/files_external/ajax')
-rw-r--r--apps/files_external/ajax/oauth2.php1
1 files changed, 1 insertions, 0 deletions
diff --git a/apps/files_external/ajax/oauth2.php b/apps/files_external/ajax/oauth2.php
index e3e32c4b912..fbe60e16e26 100644
--- a/apps/files_external/ajax/oauth2.php
+++ b/apps/files_external/ajax/oauth2.php
@@ -41,6 +41,7 @@ if (isset($_POST['client_id']) && isset($_POST['client_secret']) && isset($_POST
$client->setClientSecret((string)$_POST['client_secret']);
$client->setRedirectUri((string)$_POST['redirect']);
$client->setScopes(array('https://www.googleapis.com/auth/drive'));
+ $client->setApprovalPrompt('force');
$client->setAccessType('offline');
if (isset($_POST['step'])) {
$step = $_POST['step'];