Potentially breaking change:
- change
logout
signature from(options, callback) => void
to(options) => Promise<void>
#188
- upgrade
passport
to 0.6
- add
ip
to the Koactx
delegates #157
- add
set
toreq
to imporve compatibility with more passport strategies #128
- add
protocol
to the Koactx
delegates #121
- add
res
toreq
#114 - add
send()
method toreq
#114
- add
params
toreq
#110
- upgrade
passport
to 0.4 - add
ctx
getter toreq
#89
- remove
ctx.passport
and save state variables (like_passport
anduser
) inctx.state
instead - prevent
passport
from monkey patchinghttp.IncomingMessage
- change arguments from custom authentication callbacks from
user, info, status
toerr, user, info, status
(err
added) to be consistent with passport - add support for
assignProperty
option (#86)
- remove
ctx.req.user
deprecation warning for now #66
- fix middleware to properly catch promise errors #63
- move
user
intoctx.state
- user in
ctx.req.user
is deprecated and will removed eventually
- export KoaPassport as an alternative to the by default exported singleton
- use strict
- use promises rather than generators for
[email protected]
compatibility - use some es6 features
- export KoaPassport as an alternative to the by default exported singleton
- upgrade
passport
to^0.3.0
- fix to not throw if
req.user
is already defined - upgrade dependencies
- add
status
argument to authentication callback
- make internal
req
mock less error-prone
- redirect
req.app.get('trust proxy')
to Koa'sapp.proxy
(#22)
- add
authInfo
to 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
flash
to thereq
mock
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
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 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