koa-passport
Advanced tools
Changelog
1.1.0
Make the req
mock to inherit from Koa's request
object before adding delegates for Node's request and Koa's context to it. This makes custom properties/methods added to Koa's request available to passport and its authentication strategies.
Changelog
1.0.0
Using ES6 Proxy currently breaks debugging (see #17). Until this is fixed, the Proxy approach got replace by delegating a whitelist of possible used properties/methods to either Node's request, Koa's context or Koa's request.
Note: There is nothing special about this being 1.0.0
. The major version bump is just because the update could possible break something.
Changelog
0.5.0
req
object with a proxy that forwards reads to either Node's request object, Koa's request object or Koa's context)--harmony-proxies
has to enabled nowChangelog
0.4.0
public.post('/login', function*(next) {
var ctx = this
yield* passport.authenticate('local', function*(err, user, info) {
if (err) throw err
if (user === false) {
ctx.status = 401
ctx.body = { success: false }
} else {
yield ctx.login(user)
ctx.body = { success: true }
}
}).call(this, next)
})