Next.js Discord

Discord Forum

username-password authentication

Answered
Great Skua posted this in #help-forum
Open in Discord
Great SkuaOP
I need to build authentication using username and password. When form is submitted I need to call Django backend with data and get an answer. Cookies must be the one from response.headers.cookies. What is the easiest way to implement it? If I follow https://nextjs.org/docs/app/building-your-application/authentication#authentication-strategies I get confused what must be in signIn function imported from '@/auth'. What is the best way to implement something like that?
Answered by Wool sower gall maker
build custom auth form and just set cookie in response?
View full answer

3 Replies

Wool sower gall maker
build custom auth form and just set cookie in response?
Answer
Great SkuaOP
should I even try it to do it with server actions or not?
@Great Skua should I even try it to do it with server actions or not?
Wool sower gall maker
once the user is authenticated, on every other request he will make, auth cookie will be included, so it will work with server actions for sure