summaryrefslogtreecommitdiffstats
path: root/apps
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 12:47:47 +0100
commit2f99ee4fe588da63aac279abcf13acb9c8e1fd2d (patch)
tree8a15a92f324c38fda73c69dafca1be2fc8e9f156 /apps
parent8cea444f4e47863200911d6424caf3d606a07b20 (diff)
downloadnextcloud-server-2f99ee4fe588da63aac279abcf13acb9c8e1fd2d.tar.gz
nextcloud-server-2f99ee4fe588da63aac279abcf13acb9c8e1fd2d.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')
-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'];