Files
frontend/apps/fo/src/entities/auth/lib/auth-wrapper.tsx
T
YangJinSoo94 d641866cc4 -대시보드 메뉴 및 로그인 기능완료, 권한 완료
-대시보드 운영현황 데이터 수정, 시설명 div z-index 수정정
2025-07-22 13:21:39 +09:00

46 lines
1.2 KiB
TypeScript

// "use client";
// import { useEffect } from "react";
// import { useRouter } from "next/navigation";
// import { LoginApi } from "../api/login-service";
// const AuthWrapper = ({ children }: { children: React.ReactNode }) => {
// const router = useRouter();
// const { userInfo, setUserInfo } = useUserStore((state) => state);
// async function authCheck() {
// const userId = getCookie(AUTH_USER_ID);
// if (!userId) {
// throw new Error("Missing required authentication tokens");
// }
// const response = await client.get<IUserInfo>(
// `${ENDPOINT.USER_SERVICE.USERS}/info/me`,
// );
// if (!userInfo) setUserInfo(response.data);
// }
// useEffect(() => {
// (async () => {
// try {
// await authCheck();
// } catch (error) {
// console.error(error);
// try {
// await LoginApi.silentRefresh();
// await authCheck();
// } catch (refreshError) {
// console.error("Token refresh failed:", refreshError);
// setUserInfo(null);
// router.push("/auth/login");
// }
// }
// })();
// }, []);
// return <>{children}</>;
// };
// export { AuthWrapper };