koa-passport
Advanced tools
Comparing version 0.3.0 to 0.3.1
@@ -13,8 +13,2 @@ /** | ||
/** | ||
* Passport's HTTP IncomingMessage extension names | ||
*/ | ||
var requestExtensions = ['login', 'logIn', 'logout', 'logOut', | ||
'isAuthenticated', 'isUnauthenticated'] | ||
/** | ||
* Passport's initialization middleware for Koa. | ||
@@ -35,5 +29,10 @@ * | ||
var ctx = this | ||
requestExtensions.forEach(function(method) { | ||
ctx[method] = ctx.req[method].bind(ctx.req) | ||
}) | ||
ctx.login = ctx.logIn = function(user, options) { | ||
return function(done) { | ||
ctx.req.login(user, options, done) | ||
} | ||
} | ||
ctx.logout = ctx.logOut = ctx.req.logout.bind(ctx.req) | ||
ctx.isAuthenticated = ctx.req.isAuthenticated.bind(ctx.req) | ||
ctx.isUnauthenticated = ctx.req.isUnauthenticated.bind(ctx.req) | ||
@@ -40,0 +39,0 @@ yield middleware.bind(middleware, this.req, this) |
@@ -7,3 +7,3 @@ { | ||
}, | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"description": "Passport middleware for Koa", | ||
@@ -10,0 +10,0 @@ "keywords": [ |
# koa-passport | ||
[![NPM](https://badge.fury.io/js/koa-passport.png)](https://npmjs.org/package/koa-passport) | ||
[![Dependency Status](https://david-dm.org/rkusa/koa-passport.png?theme=shields.io)](https://david-dm.org/rkusa/koa-passport) | ||
[![NPM](https://badge.fury.io/js/koa-passport.svg)](https://npmjs.org/package/koa-passport) | ||
[![Dependency Status](https://david-dm.org/rkusa/koa-passport.svg?theme=shields.io)](https://david-dm.org/rkusa/koa-passport) | ||
@@ -5,0 +5,0 @@ [Passport](https://github.com/jaredhanson/passport) middleware for Koa |
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
6274