From 951fc87213cbbba1c9253c95227f44c40a845230 Mon Sep 17 00:00:00 2001 From: Zoltan Olah Date: Mon, 15 Jul 2013 16:03:50 -0700 Subject: [PATCH 1/2] Added support to force the approval prompt for the google oAuth flow. --- packages/google/google_client.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/google/google_client.js b/packages/google/google_client.js index 83b8c189cd..14313c5297 100644 --- a/packages/google/google_client.js +++ b/packages/google/google_client.js @@ -30,6 +30,7 @@ Google.requestCredential = function (options, credentialRequestCompleteCallback) // https://developers.google.com/accounts/docs/OAuth2WebServer#formingtheurl var accessType = options.requestOfflineToken ? 'offline' : 'online'; + var approvalPrompt = options.forceApprovalPrompt ? 'force' : 'auto'; var loginUrl = 'https://accounts.google.com/o/oauth2/auth' + @@ -38,7 +39,8 @@ Google.requestCredential = function (options, credentialRequestCompleteCallback) '&scope=' + flatScope + '&redirect_uri=' + Meteor.absoluteUrl('_oauth/google?close') + '&state=' + credentialToken + - '&access_type=' + accessType; + '&access_type=' + accessType + + '&approval_prompt=' + approvalPrompt; Oauth.initiateLogin(credentialToken, loginUrl, credentialRequestCompleteCallback); }; From 732482b5ea204885d21dc78d27098ffa5ef09f6f Mon Sep 17 00:00:00 2001 From: Zoltan Olah Date: Tue, 16 Jul 2013 10:56:08 -0700 Subject: [PATCH 2/2] Documentation for forceApprovalPrompt to meteor_loginwithexternalservice. --- docs/client/api.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/client/api.js b/docs/client/api.js index e14de34dab..a85dafa7eb 100644 --- a/docs/client/api.js +++ b/docs/client/api.js @@ -1066,6 +1066,11 @@ Template.api.loginWithExternalService = { name: "requestOfflineToken", type: "Boolean", descr: "If true, asks the user for permission to act on their behalf when offline. This stores an additional offline token in the `services` field of the user document. Currently only supported with Google." + }, + { + name: "forceApprovalPrompt", + type: "Boolean", + descr: "If true, forces the user to approve the app's permissions, even if previously approved. Currently only supported with Google." } ] };