Closed kssoftware93 closed 4 years ago
This is easy, simply name each strategy as following:
passport.use("strategyA", new JwtStrategy(jwtOptions, (payload, done) => { ... });
passport.use("strategyB", new JwtStrategy(jwtOptions, (payload, done) => { ... });
and use them analogously:
rootRouter.use(passport.authenticate("strategyA", { session: false }));
How can I created two different passport-jwt using different passwords and use it to authenticate two different roles? i test this https://stackoverflow.com/questions/39795898/multiple-passport-jwt-strategy-in-the-same-app?answertab=votes#tab-top work for me