No session is returned after Credentials login #4144
-
I'm not sure if this is a bug or if I'm just using this wrong, so please bear with me. I'm trying to integrate my Next.js app with a pre-existing database.
This is how my
I've tested that my login endpoint works on its own. When I try to login this is what happens:
My Prisma schema contains the suggested models as well as a model for my old users table:
I'm not returning a lot from my I tried console logging the data returned by the
Is there data that Next Auth always expects to be returned from the login endpoint? I can see that the Credentials docs page says:
Does it mean that I need to specifically set:
How does this interfere with other login options that do work with the database? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
So obviously as soon as I posted this I found a solution. Apparently when using credentials you need to manually encode/decode your JWT.
Specifying the session strategy is also required. |
Beta Was this translation helpful? Give feedback.
-
Thanks. |
Beta Was this translation helpful? Give feedback.
So obviously as soon as I posted this I found a solution. Apparently when using credentials you need to manually encode/decode your JWT.
Specifying the session strategy is also required.