Google Sign-In throws Error in Production
Google Sign-In is working as expected in development (localhost), but in production, it throws the following error right after the sign-in process:
31 Replies
make sure the state exists with the
verification
table or may the inspect your prod db as well or even check the correct credential are set to the prod env like client id and client secret as well but make sure the prod db do have verification
table in itit exist both in local db and production db, but when sign-in with google not create anything in verification table.. how to fix it please?
make sure you have your production url and redirect url are added for the prod client id and secret
could you give me more details what you me about production url and redirect url please?
i spend two days try to fix it
should i add (BETTER_AUTH_URL)?
and what the benefit to add (baseURL)?
redirect url you provided when you create oauth app in google console
make sure you have added your production url
so in production i added BETTER_AUTH_URL env and what about baseURL?
i added BETTER_AUTH_URL env and baseURL in betterAuth config but still the problem exist!!
could you look at onAPIError config, maybe it cause the error 'please_restart_the_process' after sign-in via google.
im saying when you create a client id and secret in google dev console, make sure to add your production redirect uri (e.g, https://my-site.com/api/auth/google) as you did for local host
i did that in google dev console, both for local and production. but the wired error still exist
is there any server log?
this what i used in production
Google dev console Authorized redirect URIs: https://my-site.com/api/auth/callback/google
.....
BETTER_AUTH_URL= https://my-site.com
baseURL= https://my-site.com
is this correct? ❓
no logs just code error = "please_restart_the_process"
Until we find the actual problem and fix it, I’ve customized the error page to redirect to the homepage as a temporary solution.
you still getiting
restart_the_process
?yes still on v1.2.6 too!



@KiNFiSH @bekacru can you check this?
Can you see if there is a log regarding to this endpoint - api/auth/callback/google ?
Can you show me how are actually calling it
this through the error:
you mean google sign-in?
This happened when we could not able to get your state with in the verification table
Yes
and the auth config:
May be can you pass the callback url as relative path like /dashboard
Plus you using nextjs right ?
Yes I’m using NextJs
Ok i will try relative path
still the problem exist
can you show me authClient config
hi, did u manage to solve this?
having the similar issue, everything works fine in local, however, dev not so much.
I'm having this exact issue on Chrome only
On production. Safari login with Google works, Chrome login with Google constantly gives me "restart_the_process"
It is calling callback twice in a row

The sign in works when I return to the website, I have the cookie.
But it shows a big error message on every Google sign in
The bug is the double request. It verifies successfully then errors out
@yasserconnect Do you have a service worker?