From 49804c0fa14b60c352f00be9c4754de1f34b2ab7 Mon Sep 17 00:00:00 2001 From: Julien Froidefond Date: Mon, 25 Aug 2025 16:22:09 +0200 Subject: [PATCH] fix: auto-login user after successful registration - Updated AuthWrapper to automatically log in the user upon successful registration. - Added toast notification for user feedback during the redirection process. - Redirects user to the home page after registration completion. --- components/login/auth-wrapper.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/components/login/auth-wrapper.tsx b/components/login/auth-wrapper.tsx index 33de413..f6299f0 100644 --- a/components/login/auth-wrapper.tsx +++ b/components/login/auth-wrapper.tsx @@ -73,8 +73,14 @@ export function AuthWrapper({ teams, initialUser }: AuthWrapperProps) { description: response.message, }); - // Basculer vers le login après inscription réussie - setIsLogin(true); + // Après inscription réussie, connecter automatiquement l'utilisateur + toast({ + title: "Connexion automatique", + description: "Redirection vers l'accueil...", + }); + + // Rediriger vers l'accueil après inscription réussie + router.push("/"); } catch (error: any) { console.error("Register failed:", error);