Skip to content

Commit

Permalink
Merge pull request #1036 from MTES-MCT/fix-login-when-logged
Browse files Browse the repository at this point in the history
fix(auth): redirect authenticated users to "Parc de logements" when accessing guest-only routes
  • Loading branch information
Falinor authored Dec 10, 2024
2 parents 01c7303 + 22c4889 commit aade944
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions frontend/src/components/Auth/RequireGuest.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { PropsWithChildren } from 'react';

import { useUser } from '../../hooks/useUser';
import NotFoundView from '../../views/NotFoundView';
import { Navigate } from 'react-router-dom';

interface RequireGuestProps {}

Expand All @@ -12,7 +12,7 @@ function RequireGuest(props: PropsWithChildren<RequireGuestProps>) {
return props.children;
}

return <NotFoundView />;
return <Navigate to="/parc-de-logements" replace />;
}

export default RequireGuest;

0 comments on commit aade944

Please sign in to comment.