mikenicholson / passport-jwt

Passport authentication using JSON Web Tokens
MIT License
1.97k stars 214 forks source link

Option to specify other name for `req.user` #161

Closed BigBallard closed 6 years ago

BigBallard commented 6 years ago

Currently, successful authorization puts the JSON payload into req.user. This is confusing for those who are not associating a user per say with the payload but maybe some other model naming convention of theirs. It would be a nice option to have an option that would specify the name in req object other than user, like account or signer, etc.

mikenicholson commented 6 years ago

https://github.com/jaredhanson/passport/blob/master/lib/authenticator.js#L117

This is a configuration option of passport and not up to individual strategies to implement. See the document for passportjs.