Skip to content
Back

Google login redirect error in auth.js and next.js

  • 2
  • Auth
  • Web
ZGravityy
30 Mar, 2025, 21:57

Hello people, I need urgent help. It's like this I'm using auth.js to authenticate my site and using Google to log in, when I click to log in with Google it redirects to the Google page I log in, but when it goes back to my site it goes to this url:

"https://www.templaite.ai/api/auth/callback/google? code=4%2F0AQSTgQETe0hEXCebjFwvY4xpq7tMfmgwTpcsUQ9Q-rEehAex-rRVAr_qjWZW4-p7NSgsQQ&scope=email+profile+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email+https%3A%2F%2Fww. googleapis.com%2Fauth%2Fuserinfo.profile+openid&authuser=0&prompt=none"

And does not create the session token, this only happens when I deploy the site on vercel Localhost does not happen.

TL;DR
A developer is facing a Google login redirect error in auth.js and next.js specifically when deploying the site on Vercel, while it works fine on localhost. Another developer with a similar issue mentioned it occurring with Flutter Android OAuth2 Google login/signup. No solution was provided within the thread.
Ankit Maniya
21 Apr, 2025, 23:47

I am also facing this issue, have you solved?

Ankit Maniya
21 Apr, 2025, 23:48

But in my case it happen with flutter android oauth2 google login/signup

Steven
22 Apr, 2025, 16:02

You're using Appwrite?

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more