Nikhil
Nikhil

Reputation: 374

What Strategy should be used in passport library of node.js

I am kinda new here. This is the first time I am implementing passport.js in my node.js project. So far What I have done is use the Local Strategy and authenticate my login parameters with the passport library and by using JWT I also created the accessToken.

I just wanna ask that Is this the correct approach or do I need to use some other passport strategy to generate accessToken and refreshToken on its own like they do in Google Strategy.

This is the github link of the code. https://github.com/nikhilgupta6532/Passport

Thankyou.

Upvotes: 0

Views: 189

Answers (1)

Tetsuya3850
Tetsuya3850

Reputation: 1019

I checked your repo. I think you are on the right track!

Some points.

You should not expose your jwt-secret to github repos. Use dotenv.

I understand that serializeUser and deserializeUser are not necessary for a jwt implementation. Only for cookie sessions?

You will need to generate a jwt besides the token supplied by google strategy.

Upvotes: 0

Related Questions