260615_01_FST: First Commit
This commit is contained in:
20
src/app/(pages)/logout/page.tsx
Normal file
20
src/app/(pages)/logout/page.tsx
Normal file
@@ -0,0 +1,20 @@
|
||||
'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 () => {
|
||||
await logoutMutation.mutateAsync()
|
||||
router.replace("/login");
|
||||
})();
|
||||
}, []);
|
||||
|
||||
return null;
|
||||
};
|
||||
|
||||
export default LogoutPage;
|
||||
Reference in New Issue
Block a user