passport-sirena-oauth2
Advanced tools
Comparing version 1.1.1 to 1.2.0
@@ -60,2 +60,19 @@ /** | ||
/** | ||
* Edit the Authenticate request to add more parameters to the authenticate request | ||
* | ||
* @param {http.IncomingMessage} req | ||
* @param {object} options | ||
* @access protected | ||
*/ | ||
Strategy.prototype.authenticate = function(req, options) { | ||
// If there's a username in the body of the request, pass it as option | ||
if (req.body && req.body.username) { | ||
options.username = req.body.username; | ||
} | ||
OAuth2Strategy.prototype.authenticate.call(this, req, options); | ||
}; | ||
/** | ||
* Retrieve user profile from the authorization server. | ||
@@ -116,4 +133,20 @@ * | ||
/** | ||
* Return extra parameters to be included in the authorization request. | ||
* | ||
* @param {object} options | ||
* @return {object} | ||
* @access protected | ||
*/ | ||
Strategy.prototype.authorizationParams = function(options) { | ||
var params = {}; | ||
if (options.username) { | ||
params['username'] = options.username; | ||
} | ||
return params; | ||
} | ||
/** | ||
* Expose `Strategy`. | ||
*/ | ||
module.exports = Strategy; |
{ | ||
"name": "passport-sirena-oauth2", | ||
"version": "1.1.1", | ||
"version": "1.2.0", | ||
"description": "Sirena (OAuth 2.0) authentication strategy for Passport", | ||
@@ -5,0 +5,0 @@ "main": "./lib", |
10496
175