Closed tobieeniafe closed 5 years ago
See the implementation of passport.use(). You need to give each strategy a new name, otherwise, the default name ('jwt') is used and the last strategy passed to passport.use()
overwrites the previous one.
You should be able to do something like:
// for cleaner
passport.use('jwt-cleaner', new JwtStrategy(....));
...
// for customer
passport.use('jwt-customer', new JwtStrategy(...));
Closing. Feel free to re-opn if you can demonstrate an issue with this strategy.
I'm trying to authenticate both users and admin using passport-jwt. I created two passport strategies, but for some reason, i get unauthorized on whichever strategy I add first to my file while the second one works. I tried separating them into files still no solution. is there a way around this?