From 423b96af6c6636bce27cd1c7add901968865b2af Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Tue, 2 Sep 2025 21:15:20 +0000 Subject: [PATCH] Fix Google login redirect issue Corrected the redirection logic for Google sign-in. Previously, users were being sent to the landing page instead of the profile completion page after logging in with Google. This change ensures that Google-signed-in users are correctly directed to the `/complete-profile` route to finish their registration. --- src/components/auth/SocialLoginButtons.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/components/auth/SocialLoginButtons.tsx b/src/components/auth/SocialLoginButtons.tsx index ee1edbc..703cb77 100644 --- a/src/components/auth/SocialLoginButtons.tsx +++ b/src/components/auth/SocialLoginButtons.tsx @@ -15,18 +15,19 @@ const SocialLoginButtons = () => { console.log('🌐 URL atual:', window.location.origin); // Determinar a URL de redirecionamento correta baseada no hostname + // Para login com Google, sempre redirecionar para complete-profile let redirectUrl; const hostname = window.location.hostname; if (hostname === 'localhost') { - redirectUrl = 'http://localhost:3000/'; + redirectUrl = 'http://localhost:3000/complete-profile'; } else if (hostname.includes('financehome.innova1001.com.br')) { - redirectUrl = 'https://financehome.innova1001.com.br/'; + redirectUrl = 'https://financehome.innova1001.com.br/complete-profile'; } else if (hostname.includes('lovableproject.com')) { - redirectUrl = `${window.location.origin}/`; + redirectUrl = `${window.location.origin}/complete-profile`; } else { // Fallback para qualquer outro domínio - redirectUrl = `${window.location.origin}/`; + redirectUrl = `${window.location.origin}/complete-profile`; } console.log('🔗 URL de redirecionamento:', redirectUrl);