From 7e26f5981871468900343334575178ee225162e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Guillois?= Date: Fri, 6 Dec 2024 12:28:45 +0100 Subject: [PATCH 1/2] fix(auth): redirect authenticated users to "Parc de logements" when accessing guest-only routes --- frontend/src/components/Auth/RequireGuest.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/Auth/RequireGuest.tsx b/frontend/src/components/Auth/RequireGuest.tsx index 320d5e44c..68bbf3895 100644 --- a/frontend/src/components/Auth/RequireGuest.tsx +++ b/frontend/src/components/Auth/RequireGuest.tsx @@ -2,6 +2,7 @@ import { PropsWithChildren } from 'react'; import { useUser } from '../../hooks/useUser'; import NotFoundView from '../../views/NotFoundView'; +import { Navigate } from 'react-router-dom'; interface RequireGuestProps {} @@ -12,7 +13,7 @@ function RequireGuest(props: PropsWithChildren) { return props.children; } - return ; + return ; } export default RequireGuest; From 22c48892ecea210fceacca3317f3a04a03c2038f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Guillois?= Date: Mon, 9 Dec 2024 10:53:06 +0100 Subject: [PATCH 2/2] fix: lint --- frontend/src/components/Auth/RequireGuest.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/frontend/src/components/Auth/RequireGuest.tsx b/frontend/src/components/Auth/RequireGuest.tsx index 68bbf3895..9f79301d8 100644 --- a/frontend/src/components/Auth/RequireGuest.tsx +++ b/frontend/src/components/Auth/RequireGuest.tsx @@ -1,7 +1,6 @@ import { PropsWithChildren } from 'react'; import { useUser } from '../../hooks/useUser'; -import NotFoundView from '../../views/NotFoundView'; import { Navigate } from 'react-router-dom'; interface RequireGuestProps {}