mikenicholson / passport-jwt

Passport authentication using JSON Web Tokens
MIT License
1.96k stars 213 forks source link

Extractor jwtFromRequest should be made asynchronous #201

Open eternalmatt opened 4 years ago

eternalmatt commented 4 years ago

I have a requirement to send the users a cookie of a uuid value, which maps to a JWT stored in a database. The database lookup returns on a promise, therefore I need to create an asyncronous jwtFromRequest extractor.

type extractor: (req) => Promise<string | undefined>

Looking at the code, I can see the token is fetched synchronously https://github.com/mikenicholson/passport-jwt/blob/v4.0.0/lib/strategy.js#L93

but if this could be converted to promise style or with an optional done callback, I would much appreciate it. And recommendations on implementation strategy?

Outternet commented 1 year ago

implemented in rewrite.

Artem-Semenov commented 5 months ago

Which rewrite?)