Files
contact-front/src/app/(pages)/logout/page.tsx

21 lines
569 B
TypeScript

'use client'
import { useLogoutMutation } from "@/query/auth";
import { useRouter } from "next/navigation";
import { useEffect } from "react";
const LogoutPage = () => {
const router = useRouter();
const logoutMutation = useLogoutMutation();
useEffect(() => {
(async () => {
const { loginType } = await logoutMutation.mutateAsync();
// 기존 로직 그대로: call 타입이면 쿼리 붙여서 이동
router.replace(loginType === "call" ? "/login?type=call" : "/login");
})();
}, []);
return null;
};
export default LogoutPage;