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.
This commit is contained in:
gpt-engineer-app[bot] 2025-09-02 21:15:20 +00:00
parent f9e15c066b
commit 423b96af6c

View File

@ -15,18 +15,19 @@ const SocialLoginButtons = () => {
console.log('🌐 URL atual:', window.location.origin); console.log('🌐 URL atual:', window.location.origin);
// Determinar a URL de redirecionamento correta baseada no hostname // Determinar a URL de redirecionamento correta baseada no hostname
// Para login com Google, sempre redirecionar para complete-profile
let redirectUrl; let redirectUrl;
const hostname = window.location.hostname; const hostname = window.location.hostname;
if (hostname === 'localhost') { if (hostname === 'localhost') {
redirectUrl = 'http://localhost:3000/'; redirectUrl = 'http://localhost:3000/complete-profile';
} else if (hostname.includes('financehome.innova1001.com.br')) { } 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')) { } else if (hostname.includes('lovableproject.com')) {
redirectUrl = `${window.location.origin}/`; redirectUrl = `${window.location.origin}/complete-profile`;
} else { } else {
// Fallback para qualquer outro domínio // Fallback para qualquer outro domínio
redirectUrl = `${window.location.origin}/`; redirectUrl = `${window.location.origin}/complete-profile`;
} }
console.log('🔗 URL de redirecionamento:', redirectUrl); console.log('🔗 URL de redirecionamento:', redirectUrl);