Skip to content

Commit

Permalink
allow display option
Browse files Browse the repository at this point in the history
  • Loading branch information
ruffrey committed Feb 26, 2015
1 parent bd51963 commit db1547d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/passport-google-oauth/oauth2.js
Expand Up @@ -134,6 +134,11 @@ Strategy.prototype.authorizationParams = function(options) {
// https://developers.google.com/accounts/docs/OAuth_ref
params['hd'] = options.hostedDomain || options.hd;
}
if (options.display) {
// Specify what kind of display consent screen to display to users.
// https://developers.google.com/accounts/docs/OpenIDConnect#authenticationuriparameters
params['display'] = options.display;
}
return params;
}

Expand Down
4 changes: 4 additions & 0 deletions test/oauth2-test.js
Expand Up @@ -61,6 +61,10 @@ vows.describe('GoogleStrategy').addBatch({
var params = strategy.authorizationParams({ hd: 'mycollege.edu' });
assert.equal(params.hd, 'mycollege.edu');
},
'should return display from display option': function (strategy) {
var params = strategy.authorizationParams({ display: 'touch' });
assert.equal(params.display, 'touch');
},
'should return access_type and approval_prompt': function (strategy) {
var params = strategy.authorizationParams({ accessType: 'offline', approvalPrompt: 'force' });
assert.equal(params.access_type, 'offline');
Expand Down

0 comments on commit db1547d

Please sign in to comment.