Next.js Discord

Discord Forum

Authentication

Answered
Velvet ant posted this in #help-forum
Open in Discord
Velvet antOP
Hello, i wanna add an authentication for my website ( like admin and user panel ). Which libraries i can use so it will work with Prisma DB ?
Answered by Anay-208 | Ping in replies
View full answer

12 Replies

next auth/authjs
better-auth is better, and it also supports prisma.
Answer
Velvet antOP
So i should use better-auth then i founded out about Auth.js??
better-auth has a lot more features and it is customizable.

However, authjs supports more databases unlike better-auth
Velvet antOP
im usining prisma for everything in my projects 😄
@Anay-208 | Ping in replies better-auth has a lot more features and it is customizable. However, authjs supports more databases unlike better-auth
Velvet antOP
i want like licensing system for users to authenticate to theyr account where they have licenses. So better-auth will be best for this option?
choosing auth is based on opinion. I prefer better-auth.
American black bear
If you want full control over your auth, i recommend lucia-auth guide to rolling your own auth. There are also examples for prisma: https://lucia-auth.com/sessions/basic-api/prisma
Read "Basic API" then "Cookies" guide for Next.js.
You can then implement rate limiting and throttling by using in-memory cache.