refactor: change login url and add logout path

This commit is contained in:
Sonny
2023-06-10 19:04:09 +02:00
parent 1c9c65e074
commit f5b3253286
3 changed files with 16 additions and 2 deletions

View File

@@ -1,6 +1,6 @@
const PATHS = {
LOGIN: "/signin",
LOGOUT: "/signout",
LOGIN: "/login",
LOGOUT: "/logout",
HOME: "/",
CATEGORY: {
CREATE: "/category/create",

14
src/pages/logout.tsx Normal file
View File

@@ -0,0 +1,14 @@
import { signOut, useSession } from "next-auth/react";
import { useEffect } from "react";
import PATHS from "constants/paths";
export default function PageLogout() {
const { status } = useSession();
useEffect(() => {
signOut({ callbackUrl: PATHS.LOGIN });
}, [status]);
return <></>;
}