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." } ] }; 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); };