From 115164e4af84095e9399f4f04458906801ac8b85 Mon Sep 17 00:00:00 2001 From: Nicklas Ansman Giertz Date: Sat, 17 Aug 2013 18:35:40 -0700 Subject: [PATCH] Add the option to use a hosted domain with google's oauth The hd option is used to restrict which email domain that are allowed to log in to your app. Starting from this commit you can pass `hostedDomain: 'example.com'` to only allow emails from the domain `example.com`. --- packages/google/google_client.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/google/google_client.js b/packages/google/google_client.js index 4f8c29c1a3..c99c376b1b 100644 --- a/packages/google/google_client.js +++ b/packages/google/google_client.js @@ -44,6 +44,10 @@ Google.requestCredential = function (options, credentialRequestCompleteCallback) '&access_type=' + accessType + '&approval_prompt=' + approvalPrompt; + if (options.hostedDomain) { + loginUrl += '&hd=' + encodeURIComponent(options.hostedDomain); + } + Oauth.initiateLogin(credentialToken, loginUrl, credentialRequestCompleteCallback,