Wednesday, 12 September 2018

Why should I be using PassportJs? Anyone ELI5?

Not to sound arrogant or anything, I do love modules that save me a lot of time. So, I decided three days back that I would create a full stack application using NodeJS. I thought it was pretty easy until i can't even move from the first process. I got too overwelhemed from all the information available. I have looked into almost all the "user login with nodejs" tutorials on Google and I am just sweating more.Despite that, I have boiled it down to the fact that I should be using something called PassportJs that uses "strategies". But the docs didn't give much away. Also, why is bcryptjs used?Something I was wondering, can't I just create a login using traditional method? In PHP, I would just match the userId with the password in database and if it matched, I would start a session. Why is this so hard to implement this in Node? Or am I completely missing something?

Submitted September 13, 2018 at 03:21AM by IamATechieNerd

No comments:

Post a Comment