link-stack/apps/link/app/(main)/logout/page.tsx
2024-12-13 16:37:20 +01:00

20 lines
473 B
TypeScript

"use client";
import { useEffect } from "react";
import { signOut } from "next-auth/react";
export default function Page() {
useEffect(() => {
const multistepSignOut = async () => {
const response = await fetch("/api/logout", {
method: "POST",
headers: { "Content-Type": "application/json" },
credentials: "same-origin",
});
signOut({ callbackUrl: "/login" });
};
multistepSignOut();
}, []);
return <div />;
}