completionId: cgen-1f2b5796113a4713a2f445b1595f6acf

cgen-1f2b5796113a4713a2f445b1595f6acf
This commit is contained in:
Builder.io 2025-11-10 20:25:25 +00:00
parent a3c1b52448
commit 925e2e8a04

View file

@ -84,11 +84,11 @@ export default function StaffLogin() {
return;
}
// Valid staff email - redirect to dashboard
// Valid staff email - redirect to admin dashboard
const params = new URLSearchParams(location.search);
const next = params.get("next");
const safeNext = next && next.startsWith("/staff") ? next : null;
navigate(safeNext || "/staff/dashboard", { replace: true });
const safeNext = next && next.startsWith("/admin") ? next : null;
navigate(safeNext || "/admin", { replace: true });
}
}, [user, loading, navigate, location.search, toastError]);