passport
Advanced tools
Comparing version 0.3.0 to 0.3.1
@@ -18,6 +18,6 @@ /** | ||
*/ | ||
module.exports = function() { | ||
exports = module.exports = function() { | ||
// HTTP extensions. | ||
require('../http/request'); | ||
exports.__monkeypatchNode(); | ||
@@ -29,1 +29,13 @@ return { | ||
}; | ||
exports.__monkeypatchNode = function() { | ||
var http = require('http'); | ||
var IncomingMessageExt = require('../http/request'); | ||
http.IncomingMessage.prototype.login | ||
http.IncomingMessage.prototype.logIn = IncomingMessageExt.logIn; | ||
http.IncomingMessage.prototype.logout | ||
http.IncomingMessage.prototype.logOut = IncomingMessageExt.logOut; | ||
http.IncomingMessage.prototype.isAuthenticated = IncomingMessageExt.isAuthenticated; | ||
http.IncomingMessage.prototype.isUnauthenticated = IncomingMessageExt.isUnauthenticated; | ||
}; |
/** | ||
* Module dependencies. | ||
*/ | ||
var http = require('http') | ||
, req = http.IncomingMessage.prototype; | ||
//var http = require('http') | ||
// , req = http.IncomingMessage.prototype; | ||
var req = exports = module.exports = {}; | ||
/** | ||
@@ -9,0 +11,0 @@ * Intiate a login session for `user`. |
@@ -5,2 +5,3 @@ /** | ||
var http = require('http') | ||
, IncomingMessageExt = require('../http/request') | ||
, AuthenticationError = require('../errors/authenticationerror'); | ||
@@ -82,2 +83,8 @@ | ||
return function authenticate(req, res, next) { | ||
if (http.IncomingMessage.prototype.logIn | ||
&& http.IncomingMessage.prototype.logIn !== IncomingMessageExt.logIn) { | ||
require('../framework/connect').__monkeypatchNode(); | ||
} | ||
// accumulator for failures from each strategy in the chain | ||
@@ -84,0 +91,0 @@ var failures = []; |
{ | ||
"name": "passport", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"description": "Simple, unobtrusive authentication for Node.js.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
43914
1030