Closed 0xTim closed 4 years ago
In Vapor 4, Tokens don't currently conform to Authenticatable. An example of where this would be useful is when invalidating a token:
Token
Authenticatable
func logoutHandler(_ req: Request) throws -> EventLoopFuture<HTTPStatus> { let token = try req.auth.require(UserToken.self) return token.delete(on: req.db).transform(to: .ok) }
Currently the only ways to achieve this are with extra DB calls, but the middleware has already done that lookup, so the token should be cached somewhere where it can be retrieved
Fixed in #672
In Vapor 4,
Token
s don't currently conform toAuthenticatable
. An example of where this would be useful is when invalidating a token:Currently the only ways to achieve this are with extra DB calls, but the middleware has already done that lookup, so the token should be cached somewhere where it can be retrieved