Skip to content

Commit 0e75aab

Browse files
committed
Merge remote-tracking branch 'jeffersonpenna/master' jaredhanson#79
2 parents b6a081f + 783d656 commit 0e75aab

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/strategy.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ function OAuth2Strategy(options, verify) {
9494
this._callbackURL = options.callbackURL;
9595
this._scope = options.scope;
9696
this._scopeSeparator = options.scopeSeparator || ' ';
97+
this._responseType = options.responseType || 'code';
9798
this._key = options.sessionKey || ('oauth2:' + url.parse(options.authorizationURL).hostname);
9899

99100
if (options.store) {
@@ -133,6 +134,7 @@ OAuth2Strategy.prototype.authenticate = function(req, options) {
133134
}
134135

135136
var callbackURL = options.callbackURL || this._callbackURL;
137+
var responseType = options.responseType || this._responseType;
136138
if (callbackURL) {
137139
var parsed = url.parse(callbackURL);
138140
if (!parsed.protocol) {
@@ -214,7 +216,7 @@ OAuth2Strategy.prototype.authenticate = function(req, options) {
214216
}
215217
} else {
216218
var params = this.authorizationParams(options);
217-
params.response_type = 'code';
219+
params.response_type = responseType;
218220
if (callbackURL) { params.redirect_uri = callbackURL; }
219221
var scope = options.scope || this._scope;
220222
if (scope) {

0 commit comments

Comments
 (0)