Next.js Discord

Discord Forum

Vercel Platforms Repo Google Auth Localhost state error with Next Auth

Unanswered
Mini Lop posted this in #help-forum
Open in Discord
Mini LopOP
I am trying to get this Google Auth to work on localhost with this template https://github.com/vercel/platforms

There was an answer in this issue https://github.com/vercel/platforms/issues/329

But it does not seem to be working for me.

The suggestion was to set NEXTAUTH_URL to localhost:8888

I then add http://localhost:8888/api/auth/callback/google to googles config in the console

However when I sign in with google and am sent back to http://localhost:8888/login?callbackUrl=http%3A%2F%2Flocalhost%3A8888&error=OAuthCallback

I get this error in the server

 providerId: 'google',
 message: 'State cookie was missing.'


Now I don't even know how next is running on 8888, since my app is on 3000

The whole reason I have to do this though is because my structure is setup for multi tenancy and the app url is app.localhost:3000 and google calback url does not accept subdomains in google console config credentials.

0 Replies