koa-passport
Advanced tools
Comparing version 0.5.0 to 0.5.1
@@ -22,8 +22,14 @@ /** | ||
return function* passportInitialize(next) { | ||
var ctx = this | ||
// koa <-> connect compatibility: | ||
this.passport = {} | ||
var req = createReqMock(this) | ||
Object.defineProperty(ctx.req, 'user', { | ||
enumerable: true, | ||
get: function() { return ctx.passport.user } | ||
}) | ||
var req = createReqMock(ctx) | ||
// add aliases for passport's request extensions to `ctx` | ||
var ctx = this, login = ctx.req.login | ||
var login = ctx.req.login | ||
ctx.login = ctx.logIn = ctx.req.login = function(user, options) { | ||
@@ -36,3 +42,3 @@ return login.bind(req, user, options) | ||
yield middleware.bind(middleware, req, this) | ||
yield middleware.bind(middleware, req, ctx) | ||
yield next | ||
@@ -39,0 +45,0 @@ } |
@@ -7,3 +7,3 @@ { | ||
}, | ||
"version": "0.5.0", | ||
"version": "0.5.1", | ||
"description": "Passport middleware for Koa", | ||
@@ -10,0 +10,0 @@ "keywords": [ |
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
9183
141