- add
settoreqto imporve compatibility with more passport strategies #128
- add
protocolto the Koactxdelegates #121
- add
restoreq#114 - add
send()method toreq#114
- add
paramstoreq#110
- upgrade
passportto 0.4 - add
ctxgetter toreq#89
- remove
ctx.passportand save state variables (like_passportanduser) inctx.stateinstead - prevent
passportfrom monkey patchinghttp.IncomingMessage - change arguments from custom authentication callbacks from
user, info, statustoerr, user, info, status(erradded) to be consistent with passport - add support for
assignPropertyoption (#86)
- remove
ctx.req.userdeprecation warning for now #66
- fix middleware to properly catch promise errors #63
- move
userintoctx.state - user in
ctx.req.useris deprecated and will removed eventually
- export KoaPassport as an alternative to the by default exported singleton
- use strict
- use promises rather than generators for
koa@2.xcompatibility - use some es6 features
- export KoaPassport as an alternative to the by default exported singleton
- upgrade
passportto^0.3.0
- fix to not throw if
req.useris already defined - upgrade dependencies
- add
statusargument to authentication callback
- make internal
reqmock less error-prone
- redirect
req.app.get('trust proxy')to Koa'sapp.proxy(#22)
- add
authInfoto request mock
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.
- add
flashto thereqmock
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.
- re-add authenticated user to
req.user
- internal improvements (neither modify Node's request nor Koa's request object by mocking the
reqobject with a proxy that forwards reads to either Node's request object, Koa's request object or Koa's context) --harmony-proxieshas to enabled now
- Add support for custom authentication methods, e.g.:
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)
})- add generator function names for Koa debugging purposes
- make ctx.login() yieldable
- adapt recent Koa API changes
- `passport 0.2.x compatibility