Next.js Discord

Discord Forum

Authentication - Server action or client side?

Unanswered
Chinese Alligator posted this in #help-forum
Open in Discord
Chinese AlligatorOP
Hi, I’m working on a Next.js project and I’m trying to decide the best way to handle authentication with Auth.js credentials (and form submission). Would you recommend using server actions (e.g. <form action={register}>) or handling everything client-side via handleSubmit() ? Does anyone have an up-to-date tutorial or boilerplate that shows the best practices for handling both login and registration using Auth.js ? I found this but I don't know if it's the best way to do it: https://github.com/tapascript/learn-next-auth/blob/04-persist-auth-mongo/src/components/RegistrationForm.jsx

0 Replies