koa-passport
Advanced tools
Comparing version 3.0.0 to 4.0.0
# Changelog | ||
## upcoming 3.0 | ||
## 4.0.0 | ||
- upgrade `passport` to 0.4 | ||
- add `ctx` getter to `req` #89 | ||
## 3.0.0 | ||
- remove `ctx.passport` and save state variables (like `_passport` and `user`) in `ctx.state` instead | ||
@@ -122,2 +127,2 @@ - prevent `passport` from monkey patching `http.IncomingMessage` | ||
- `passport 0.2.x compatibility | ||
- `passport 0.2.x compatibility |
@@ -147,2 +147,9 @@ // Koa and Express are fundamental different in how they deal with extensions | ||
Object.defineProperty(req, 'ctx', { | ||
enumerable: true, | ||
get: function() { | ||
return ctx | ||
} | ||
}) | ||
// add passport http.IncomingMessage extensions | ||
@@ -149,0 +156,0 @@ req.login = IncomingMessageExt.logIn |
@@ -7,3 +7,3 @@ { | ||
}, | ||
"version": "3.0.0", | ||
"version": "4.0.0", | ||
"description": "Passport middleware for Koa", | ||
@@ -21,10 +21,10 @@ "keywords": [ | ||
"dependencies": { | ||
"passport": "^0.3.2" | ||
"passport": "^0.4.0" | ||
}, | ||
"devDependencies": { | ||
"chai": "^3.5", | ||
"koa": "^2.0.0-alpha.5", | ||
"koa-bodyparser": "^4.0.0", | ||
"chai": "^4.1", | ||
"koa": "^2.3.0", | ||
"koa-bodyparser": "^4.2.0", | ||
"koa-route": "^3.2", | ||
"mocha": "^3.0", | ||
"mocha": "^3.5.0", | ||
"passport-local": "^1.0", | ||
@@ -31,0 +31,0 @@ "supertest": "^3.0" |
@@ -29,6 +29,5 @@ # koa-passport | ||
// Sessions | ||
const convert = require('koa-convert') // necessary until koa-generic-session has been updated to support koa@2 | ||
const session = require('koa-generic-session') | ||
const session = require('koa-session') | ||
app.keys = ['secret'] | ||
app.use(convert(session())) | ||
app.use(session({}, app)) | ||
@@ -48,3 +47,3 @@ const passport = require('koa-passport') | ||
ctx.isUnauthenticated() | ||
ctx.login() | ||
await ctx.login() | ||
ctx.logout() | ||
@@ -51,0 +50,0 @@ ctx.state.user |
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
333
16552
7
59
+ Addedpassport@0.4.1(transitive)
- Removedpassport@0.3.2(transitive)
Updatedpassport@^0.4.0