Next.js Discord

Discord Forum

NextAuth constant reloading of login page.

Answered
English Lop posted this in #help-forum
Open in Discord
English LopOP
Hi there, unsure about this as I'm just starting out.

I added nextauth and it's working fine but the moment i added prisma as an adaptor when i visit a page that's auth locked it will constantly make me login without working. please view video attached.
Answered by English Lop
fixed it.
needed to add

    session: {
        strategy: 'jwt',
    },

and
    secret: process.env.NEXTAUTH_SECRET,


to my options.ts file for my providers
View full answer

2 Replies

English LopOP
does anyone have any idea 😌
English LopOP
fixed it.
needed to add

    session: {
        strategy: 'jwt',
    },

and
    secret: process.env.NEXTAUTH_SECRET,


to my options.ts file for my providers
Answer