Enes KOC
Enes KOC

Reputation: 41

[next-auth][error][CLIENT_FETCH_ERROR] Next auth error on google App Engine

The problem:

My next-auth works locally, but when I deploy it to google App Engine I get this [next-auth][error][CLIENT_FETCH_ERROR] invalid json response body at https://accounts.google.com/InteractiveLogin...

Works fine in dev mode but not in production... I've seen a lot of forums talking about NEXTAUTH_URL but it is set correctly.

See the error log here

Any idea about where the issue could come from?

What I have already checked locally and on GAE:

Upvotes: 2

Views: 2806

Answers (1)

Enes KOC
Enes KOC

Reputation: 41

Well, I ended up fixing it.

Turns out, the application is running on localhost:8080 inside App_Engine so putting my NEXTAUTH_URL as my domain wouldn't work.

Fortunately, Next auth taught this through and I simply added NEXTAUTH_URL_INTERNAL=http://localhost:8080 as a new env variable and now it works like a charm!

Here's the doc

Upvotes: 2

Related Questions