summaryrefslogtreecommitdiffstats
path: root/apps/files_external/ajax
diff options
context:
space:
mode:
authorAdam Williamson <awilliam@redhat.com>2014-02-04 23:19:33 -0800
committerAdam Williamson <awilliam@redhat.com>2014-11-06 18:47:11 -0800
commit61d70b17ee622d8b75c0201835321ac8d1137c76 (patch)
treee46b4340c77ef299815807dd65d77b2210d0eedf /apps/files_external/ajax
parent18707f5abaea9d1e55109a3847dff7bb1430799e (diff)
downloadnextcloud-server-61d70b17ee622d8b75c0201835321ac8d1137c76.tar.gz
nextcloud-server-61d70b17ee622d8b75c0201835321ac8d1137c76.zip
google drive: set access type to 'offline' when requesting token
We need to do this in order to be able to refresh the access token without prompting the user for their credentials every hour. This was the default in 0.6 of the Google library, but needs to be explicitly specified in 1.0.
Diffstat (limited to 'apps/files_external/ajax')
-rw-r--r--apps/files_external/ajax/google.php1
1 files changed, 1 insertions, 0 deletions
diff --git a/apps/files_external/ajax/google.php b/apps/files_external/ajax/google.php
index f967140a6c8..b80f24bbd2c 100644
--- a/apps/files_external/ajax/google.php
+++ b/apps/files_external/ajax/google.php
@@ -14,6 +14,7 @@ if (isset($_POST['client_id']) && isset($_POST['client_secret']) && isset($_POST
$client->setClientSecret($_POST['client_secret']);
$client->setRedirectUri($_POST['redirect']);
$client->setScopes(array('https://www.googleapis.com/auth/drive'));
+ $client->setAccessType('offline');
if (isset($_POST['step'])) {
$step = $_POST['step'];
if ($step == 1) {