loading...

Discussion on: User Authentication with Next.js

Collapse
ethanbonsignori profile image
Ethan Bonsignori

Hey Juan, I'm new to Next and this guide seems like it will be a huge help. I'm working on a school project and currently I'm using a decoupled express backend with a mongo database. I was going to use passport for user auth, but your guide seems really great. I thought I'd check with you to see what is the better option. Is it possible to use your guide here and change the backend files to work with express? I'm pretty new to this stuff so I appreciate any guidance.

Collapse
jolvera profile image
Juan Olvera Author

Hey Ethan.

Yes, you can use Express and Passport. Although, you could write helper functions to issue and verify JWTs using jsonwebtoken, since the Next.js app will manage most of the user authentication/authorization logic.

If you are using Now 2 to deploy, you could even avoid Express and Passport altogether.

But answering your question, yes you can implement what I did in the tutorial to work with Express.