From 56a70cd83ddbf3e6b6bcf21a52c931bc50d97d0c Mon Sep 17 00:00:00 2001 From: James Bhattarai Date: Wed, 8 Apr 2026 11:45:13 +0545 Subject: [PATCH] Fix: Previously after join the invite link would navigate to create org. Refresh the auth context and check org so newly joined org is reflected. --- src/pages/auth/InviteAcceptPage.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pages/auth/InviteAcceptPage.tsx b/src/pages/auth/InviteAcceptPage.tsx index 19b8db1..b4f905f 100644 --- a/src/pages/auth/InviteAcceptPage.tsx +++ b/src/pages/auth/InviteAcceptPage.tsx @@ -11,7 +11,7 @@ export default function InviteAcceptPage() { const navigate = useNavigate(); const [searchParams] = useSearchParams(); const token = searchParams.get("token") || ""; - const { login } = useAuth(); + const { refreshUser, checkOrgAdmin } = useAuth(); const [name, setName] = useState(""); const [password, setPassword] = useState(""); @@ -63,6 +63,8 @@ export default function InviteAcceptPage() { // Store the token manually since we're not using the normal login flow localStorage.setItem("secuird_token", result.token); } + await refreshUser(); + await checkOrgAdmin(); navigate("/profile"); } catch (err: unknown) { const msg = err instanceof ApiError ? err.message : "Failed to accept invite.";