Comparing version 0.1.2 to 0.1.3
@@ -25,3 +25,4 @@ /** | ||
/** | ||
* Fail authentication, with optional `challenge`. | ||
* Fail authentication, with optional `challenge` and `status`, defaulting to | ||
* 401. | ||
* | ||
@@ -31,5 +32,6 @@ * Strategies should call this function to fail an authentication attempt. | ||
* @param {String} challenge | ||
* @param {Number} status | ||
* @api public | ||
*/ | ||
actions.fail = function(challenge) { | ||
actions.fail = function(challenge, status) { | ||
this.delegate.fail.apply(this, arguments); | ||
@@ -36,0 +38,0 @@ } |
@@ -246,3 +246,3 @@ /** | ||
*/ | ||
exports.version = '0.1.2'; | ||
exports.version = '0.1.3'; | ||
@@ -249,0 +249,0 @@ /** |
@@ -80,3 +80,3 @@ /** | ||
} | ||
delegate.fail = function(challenge) { | ||
delegate.fail = function(challenge, status) { | ||
if (callback) { | ||
@@ -88,2 +88,8 @@ return callback(null, false); | ||
if (typeof challenge == 'number') { | ||
status = challenge; | ||
challenge = null; | ||
} | ||
// When failure handling is not delegated to the application, the default | ||
@@ -93,3 +99,3 @@ // is to respond with 401 Unauthorized. Note that the WWW-Authenticate | ||
// actions#fail). | ||
res.statusCode = 401; | ||
res.statusCode = status || 401; | ||
if (challenge) { | ||
@@ -111,3 +117,3 @@ this.res.setHeader('WWW-Authenticate', challenge); | ||
strategy.authenticate(req); | ||
strategy.authenticate(req, options); | ||
} | ||
@@ -114,0 +120,0 @@ } |
@@ -22,5 +22,6 @@ /** | ||
* @param {Object} req | ||
* @param {Object} options | ||
* @api protected | ||
*/ | ||
Strategy.prototype.authenticate = function(req) { | ||
Strategy.prototype.authenticate = function(req, options) { | ||
throw new Error('Strategy#authenticate must be overridden by subclass'); | ||
@@ -27,0 +28,0 @@ } |
{ | ||
"name": "passport", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "Authentication framework for Connect and Express.", | ||
@@ -5,0 +5,0 @@ "author": "Jared Hanson <jaredhanson@gmail.com> (http://www.jaredhanson.net/)", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
20291
651
1