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`.
This commit is contained in:
Nicklas Ansman Giertz
2013-08-17 18:35:40 -07:00
committed by Slava Kim
parent 04e34670bf
commit 115164e4af

View File

@@ -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,