Next.js Discord

Discord Forum

Help using prismaAdapter. Middleware does not find token

Unanswered
American black bear posted this in #help-forum
Open in Discord
American black bearOP
I have set the adapter in NextAuthOptions.
When I login using my provider (google), user is succesfully stored in db. (Im using the schema file provided in prismaAdapter docs)
The problem is, in middleware.ts I have specified to not allow unauthenticated users enter urls begining with /dashboard. For some reason it believes user is not logged, when it actually is (getServerSession(authOptions) returns a non-null session).

Thank you for your help.

0 Replies