Session is not being created when logged in
Solution:Jump to solution
they come from next auth https://next-auth.js.org/configuration/callbacks
Callbacks | NextAuth.js
Callbacks are asynchronous functions you can use to control what happens when an action is performed.
11 Replies
you have to make the session with
adapter.createSession()
not sure if ur making it somewhere else but its not hereI don’t understand
I am creating a custom credentials to sign the user is being created but the session is not created when signed in
Where would I put this
adapter.createSession()
Please explain
@brickin ur callbacks make one where you set the cookie
next auth will call it once it needs to make a session
are you talking about this?
@brick
sorry for the long wait
this is the callbacks
@brick
yes, probably would look something like this depends on what you want
the adapter.createSession where does it come from?
I don't understand. What time do you wrong? I followed the following resources.
NextAuth.js
Authentication for Next.js
Build SaaS with Ethan
YouTube
Set up Next-Auth with Next.js and Prisma with this ultimate guide!
This is the ULTIMATE guide for setting up Next Auth with the credential provider and Prisma. Check out my other video for setting up Prisma and then dive in to hook it all up.
Learn how to protect routes, get session information, and configure everything so you can fully use Next Auth.
ALL IN THE APP DIRECTORY!
Let's go!
🔖 Chapters 🔖
00:00 ...
@brick
this is the updated code with the signing
https://paste.gg/p/anonymous/16f42850c39f4d2d8a9d71df278f8f4e
Solution
they come from next auth https://next-auth.js.org/configuration/callbacks
Callbacks | NextAuth.js
Callbacks are asynchronous functions you can use to control what happens when an action is performed.