Relative Content

Tag Archive for next-auth

NextAuth does not redirect to Google Login in production

I have a NextJS application running on a windows server (node version 22.2.0) and I’m using NextAuth for Google Authentification for a limited number of accounts (external mode in google provider). Database is in MSSQL via prisma.
This works perfect locally with remote database, but as I have this app now in production, the redirect to the google Login doesn’t work. It just stays on NextAuth default provider selection (no custom login page). In the URL, I can see the body changing, but it is not opening the Google Login page.
You can even try it out if you want enter link description here
Even the NextAuth debugs looking OK to me:

NextAuth Authentication Error: “State cookie was missing.”

NextAuth Authentication Error: “State cookie was missing.” I am using Next.js with NextAuth for OAuth2 authentication. Here is the code snippet: import NextAuth from ‘next-auth’; import DiscordProvider from ‘next-auth/providers/discord’; import jwt from ‘jsonwebtoken’; export default NextAuth({ debug: true, providers: [ DiscordProvider({ clientId: process.env.DISCORD_CLIENT_ID || “”, clientSecret: process.env.DISCORD_CLIENT_SECRET || “”, authorization: { params: { scope: ‘identify’ […]