How to set redirect after login for Google Auth
ā¹ļø info
I'm using Google Auth as authProvider
I followed the docs and added
return Promise.resolve("/clients");
in my authProvider
https://refine.dev/docs/api-reference/core/hooks/auth/useLogin/#redirection-after-login
But it does not work
ā issue
1. Wrong redirect
My first menu url is {{url}}/projects
, after I logged in, it will redirect to {{url}}/projects
, but it should be {{url}}/clients
2. Wrong hostname
I've deploy my site to Netlify
After I logged in, it will return to localhost:3000/projects
not the Netlify app url.
Could you help me to resolve the redirect issue šāuseLogin | refine
useLogin data hook from refine is a modified version of react-query's useMutation for authentication.
2 Replies
wise-whiteā¢2y ago
Hey @åå²å®,
The problem is not related with refine. You need to update redirect url on google auth.
Probaply the user goes to the a login page after the log in comes back by default to localhost:3000.
ratty-blushOPā¢2y ago
Finally, I found it here!
https://supabase.com/docs/learn/auth-deep-dive/auth-google-oauth