Google OAuth redirect is going to backend homepage instead of frontend after login.
I have a NestJS backend and TanStack Router in the frontend. Email and password login is working fine, but Google Sign-In redirects to the backend homepage after login. How can I fix this
3 Replies
server code,
and client side code
this fixed my problem
Thank you @nomandhoni
Beautiful. I was searching it here and there for hours. 😅
So, basically we have to explicitly define the
redirectURI in the server to handle the callback from the Google OAuth flow and then also explicitly define the callbackURL in the frontend so the server knows where to redirect after handling the successful login from Google Sign-in (or other OAuth).
Many thanks for your help 🙏