mirror of
https://github.com/Sonny93/my-links.git
synced 2025-12-09 15:05:35 +00:00
refactor: change login url and add logout path
This commit is contained in:
@@ -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
14
src/pages/logout.tsx
Normal 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 <></>;
|
||||
}
|
||||
Reference in New Issue
Block a user