Next.js Discord

Discord Forum

Next-Auth VS Supabase

Answered
CyberNinja posted this in #help-forum
Open in Discord
Hi,

I'm working on a fairly large app, and it's all about user authentication. Basically, I've got this custom API that handles registration and login using tokens that expire after a certain number of days. Once you're authenticated, the API takes care of storing your info in the database or updating it if there are any changes. And the API is already connected to Supabase DB, which makes it super easy to work with.

Now, I'm trying to figure out the best way to handle authentication on my website. Should I go with Next-Auth since my API is already hooked up to Supabase or stick with Supabase itself?
Answered by joulev
supabase already has an auth client that works in server components, so I would simply use that https://supabase.com/docs/guides/auth/auth-helpers/nextjs
View full answer

2 Replies