tiefen_space_h5/components/WithAuth/index.js

8 lines
205 B
JavaScript
Raw Normal View History

2024-07-03 19:59:39 +08:00
import { checkAuth } from "@/utils/auth";
import { redirect } from "next/navigation";
export default function WithAuth(WrappedComponent) {
return checkAuth() ? WrappedComponent : redirect("/login");
}