Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pass arbitrary info from Strategy#validate to done callback
Some passport strategies require to pass arbitrary arguments to done callback. For example https://github.com/jaredhanson/passport-totp#configure-strategy requires to pass key and period. Or it can be info data for req.authInfo (related to nestjs#24). Now one can return array from Strategy#validate method, like ```ts async validate(payload: JwtPayload) { const user = await this.authService.validateUser(payload); if (!user) { throw new UnauthorizedException(); } return [user, 'some info']; } ```
- Loading branch information