Hey Devs !
As a front-end developer my nightmare was to handle the user authentication.
With NextAuth.js (I will call it auth.js since they are c...
For further actions, you may consider blocking this person and/or reporting abuse
Quite useful content and very clear explanation, thanks @ekimcem
Thank you, @ekimcem.
One of the best articles on this topic.
what does the expected fetch response look like? and what does should return after fetch? my response look like this
Actually it depends what you want to return when the user signin.
Generally I return the user data like username, email, user type, user id, etc.
When the user signs in you will need some of the user's properties in order to display relevant data in your app.
so it depends on your app and backend structure. @haniframadhani
I have my custom signin page, How can I adjust your code in my code ?
@sait
For custom signin page, you should add "pages"object into your nextauth config;
like in the example
and then assign your custom signin page route into the signIn.
The thing is you need to import signin function from nextauth and provide the required credentials into that function.
Thanks
Can you make an updated version of this code in TS?
Will add it soon.