260123_ENH : Layout가지 완성된 최초 commit

This commit is contained in:
2026-01-23 11:58:39 +09:00
parent cd4e47ce22
commit 649e7f4b26
81 changed files with 5608 additions and 343 deletions

View File

@@ -0,0 +1,39 @@
'use client'
import {useAuth} from "@/hooks/useAuth";
import {useLoading} from "@/hooks/useLoading";
import {useRouter} from "next/navigation";
import {useEffect} from "react";
import {apiError} from "@/lib/http-util";
import {nextApi} from "@/lib/http-client";
const LogoutPage = () => {
const { auth, logout } = useAuth();
const { withLoadingAsync } = useLoading();
const router = useRouter();
useEffect(() => {
const runLogout = async () => {
const userId = auth.user?.userId ?? "";
logout();
try {
if(userId !== ""){
const logoutRequestOptions = {autoLogoutOnAuthError: false};
await nextApi.post(`/logout/${userId}`, null, logoutRequestOptions);
}
} catch (e) {
const err = apiError(e);
console.error(err.status, err.code, err.message);
}
router.replace("/login");
};
withLoadingAsync(runLogout);
}, []);
return null;
}
export default LogoutPage;