Recommendations for Authentication in Next.js
Hi everyone,
I’m currently learning Next.js and have reached the topic of authentication. While exploring, I’ve come across several libraries like NextAuth.js (now known as Auth.js), Clerk, and others. However, I’m feeling a bit overwhelmed trying to decide which library would be the best fit for my requirements.
Here’s what I’m trying to achieve:
- When a user signs up, I want to store their information in my backend database and then redirect them to the login page.
- When the user logs in, a JWT token should be generated and sent to my backend to authenticate the specific user.
- I’d like the flexibility to customize the authentication flow as needed.
Given these requirements, which library would you recommend that is beginner-friendly yet offers a good level of customization and flexibility?