From fb622f918ac349f1f1560e8286b8d60bb3fc39d6 Mon Sep 17 00:00:00 2001 From: LandaMm Date: Sat, 7 Jun 2025 00:13:17 +0200 Subject: [PATCH] feat: redirect to verify when required --- web/src/layout/AuthLayout.tsx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/web/src/layout/AuthLayout.tsx b/web/src/layout/AuthLayout.tsx index adc75f8..77bbede 100644 --- a/web/src/layout/AuthLayout.tsx +++ b/web/src/layout/AuthLayout.tsx @@ -31,6 +31,8 @@ const AuthLayout = () => { const authenticate = useAuth((state) => state.authenticate); const hasAuthenticated = useAuth((state) => state.hasAuthenticated); + const authProfile = useAuth((s) => s.profile); + const signInRequired = useAuth((state) => state.signInRequired); const location = useLocation(); @@ -136,6 +138,14 @@ const AuthLayout = () => { ); } + if ( + !signInRequired && + authProfile?.email_verified === false && + !location.pathname.startsWith("/verify") + ) { + return ; + } + return (