tiefen_space_h5/components/WithAuth/index.js

8 lines
205 B
JavaScript

import { checkAuth } from "@/utils/auth";
import { redirect } from "next/navigation";
export default function WithAuth(WrappedComponent) {
return checkAuth() ? WrappedComponent : redirect("/login");
}