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.
This commit is contained in:
2026-04-08 11:45:13 +05:45
parent f3e0f806cc
commit 56a70cd83d
+3 -1
View File
@@ -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.";