Skip to content

Commit f29f376

Browse files
Fix: Redirect to landing page on production
Ensured the "Retour" button in AuthForm.tsx correctly redirects to the landing page on both local and production environments. Modified the `handleBackToLanding` function to use `window.location.href = '/';` to ensure proper redirection.
1 parent 833a635 commit f29f376

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/components/AuthForm.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
import { useState } from 'react';
23
import { Button } from '@/components/ui/button';
34
import { Input } from '@/components/ui/input';
@@ -9,6 +10,7 @@ import { useToast } from '@/hooks/use-toast';
910
import { Chrome, Mail, Lock, ArrowLeft } from 'lucide-react';
1011
import { useTranslation } from 'react-i18next';
1112
import { RefSpringLogo } from '@/components/RefSpringLogo';
13+
import { useNavigate } from 'react-router-dom';
1214

1315
export const AuthForm = () => {
1416
const [isLogin, setIsLogin] = useState(true);
@@ -19,6 +21,7 @@ export const AuthForm = () => {
1921
const { signInWithEmail, signUpWithEmail, signInWithGoogle } = useAuth();
2022
const { toast } = useToast();
2123
const { t } = useTranslation();
24+
const navigate = useNavigate();
2225

2326
const handleSubmit = async (e: React.FormEvent) => {
2427
e.preventDefault();
@@ -69,7 +72,7 @@ export const AuthForm = () => {
6972
};
7073

7174
const handleBackToLanding = () => {
72-
window.location.href = '/';
75+
navigate('/');
7376
};
7477

7578
return (

0 commit comments

Comments
 (0)