Next.js Discord

Discord Forum

How to make an auth system ?

Answered
Mathissou posted this in #help-forum
Open in Discord
I am trying to make an auth system. When the form is submited, it create a token from the server, and wait for the response, then store it in the local storage, & then redirect on the /home page...
Answered by B33fb0n3
to make an auth system yourself can be pretty hard and of course auth needs security. I recommend you using a bullet proof auth system. For nextjs I prefer next-auth: https://next-auth.js.org/getting-started/introduction

And yes you can still login with credentials like email and password 🙂
View full answer

9 Replies

That is my function that must be executed when the form is submited
and here is my form
sorry, it is the first time i am using Nextjs
@Mathissou I am trying to make an auth system. When the form is submited, it create a token from the server, and wait for the response, then store it in the local storage, & then redirect on the /home page...
to make an auth system yourself can be pretty hard and of course auth needs security. I recommend you using a bullet proof auth system. For nextjs I prefer next-auth: https://next-auth.js.org/getting-started/introduction

And yes you can still login with credentials like email and password 🙂
Answer