Login, logout and middleware updates
This commit is contained in:
parent
f552f8024f
commit
9fb3665ced
18 changed files with 96 additions and 50 deletions
|
|
@ -1,9 +1,20 @@
|
|||
"use client";
|
||||
|
||||
import { useEffect } from "react";
|
||||
import { signOut } from "next-auth/react";
|
||||
|
||||
export default function Page() {
|
||||
signOut({ callbackUrl: "/login" });
|
||||
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 />;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue