Express Passport http media and local

Hello I am trying to implement an auth system with tokens. My approach is this:

First I authenticate / register a user through passport-local

, create a token and send it to the client. But since I am not using sessions and cookies, the user is not getting them in req.user

.

My question is if it is possible to call the strategy passport-http-bearer

right after I have authenticated the user with a local passport, so it is installed req.user

.

Because right now I need to make another API call to a different route in order to activate the strategy passport-http-bearer

, so it req.user

gets set and saved.

+3


source to share


1 answer


Check it out Multiple strategies in one app



Hope this helps.

0


source







All Articles