20 lines
473 B
TypeScript
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 />;
|
|
}
|