authentication
Advanced tools
Comparing version 0.0.3 to 0.0.4
@@ -51,3 +51,3 @@ /** | ||
this._passport.session.user = user._id; | ||
this._passport.session.usertype = user.type; | ||
this._passport.session.type = user.type; | ||
done(); | ||
@@ -74,2 +74,3 @@ } else { | ||
delete this._passport.session.user; | ||
delete this._passport.session.type; | ||
} | ||
@@ -84,3 +85,3 @@ }; | ||
*/ | ||
req.isAuthenticated = function () { | ||
req.isAuthenticated = function (usertype) { | ||
var property = 'user'; | ||
@@ -91,2 +92,5 @@ if (this._passport && this._passport.instance) { | ||
if (this._passport && this._passport.session) { | ||
var type= this._passport.session.type; | ||
if(usertype != type) | ||
return false; | ||
return (this._passport.session.user) ? true : false; | ||
@@ -93,0 +97,0 @@ } |
{ | ||
"name": "authentication", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "just like passport", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
7075
224