From 357583f54db4d1456164aa86f74e677dc981a4e3 Mon Sep 17 00:00:00 2001 From: LandaMm Date: Sat, 7 Jun 2025 01:34:13 +0200 Subject: [PATCH] feat: navigate to current stage of verification --- web/src/layout/VerificationLayout.tsx | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/web/src/layout/VerificationLayout.tsx b/web/src/layout/VerificationLayout.tsx index b1f863c..9292487 100644 --- a/web/src/layout/VerificationLayout.tsx +++ b/web/src/layout/VerificationLayout.tsx @@ -3,7 +3,7 @@ import { useAuth } from "@/store/auth"; import { useVerify } from "@/store/verify"; import { Eye, MailCheck, ScanFace } from "lucide-react"; import { useEffect, type FC } from "react"; -import { Outlet, useLocation } from "react-router"; +import { Navigate, Outlet, useLocation } from "react-router"; const steps = [ { @@ -37,6 +37,18 @@ const VerificationLayout: FC = () => { if (profile) loadStep(profile); }, [loadStep, profile]); + if (step === "email" && !location.pathname.startsWith("/verify/email")) { + return ; + } + + if (step === "avatar" && !location.pathname.startsWith("/verify/avatar")) { + return ; + } + + if (step === "review" && !location.pathname.startsWith("/verify/review")) { + return ; + } + return (