diff --git a/src/lib/auth.tsx b/src/lib/auth.tsx index adde904..589c809 100644 --- a/src/lib/auth.tsx +++ b/src/lib/auth.tsx @@ -148,15 +148,14 @@ export function useAuth() { return ctx; } -export function RequireAuth(props: ParentProps<{ fallback?: string }>) { +export function RequireAuth(props: ParentProps) { const navigate = useNavigate(); const auth = useAuth(); - const fallback = props.fallback || '/login'; createEffect(() => { if (typeof window === 'undefined') return; if (!auth.isAuthenticated()) { - navigate(fallback, { replace: true }); + navigate('/login', { replace: true }); } });