diff --git a/frontend/src/features/auth/LoginPage.tsx b/frontend/src/features/auth/LoginPage.tsx index 28699ed..296e803 100644 --- a/frontend/src/features/auth/LoginPage.tsx +++ b/frontend/src/features/auth/LoginPage.tsx @@ -31,19 +31,27 @@ export const LoginPage = () => { }; const onSubmit = async (data: LoginForm) => { + console.log("DEBUG: Login form submitted", data); try { setGlobalError(null); const loginData = isParentMode ? { email: data.identifier, password: data.password } : { username: data.identifier, password: data.password }; + console.log("DEBUG: Calling login with", loginData); await login(loginData); + console.log("DEBUG: Login successful, navigating"); navigate('/'); } catch (err) { + console.error("DEBUG: Login error caught in component", err); setGlobalError("Identifiants invalides ou erreur de connexion"); } }; + const onError = (errors: any) => { + console.log("DEBUG: Form validation failed", errors); + }; + return (