mirror of
https://github.com/Sonny93/my-links.git
synced 2025-12-11 08:43:04 +00:00
refactor: change login url and add logout path
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
const PATHS = {
|
const PATHS = {
|
||||||
LOGIN: "/signin",
|
LOGIN: "/login",
|
||||||
LOGOUT: "/signout",
|
LOGOUT: "/logout",
|
||||||
HOME: "/",
|
HOME: "/",
|
||||||
CATEGORY: {
|
CATEGORY: {
|
||||||
CREATE: "/category/create",
|
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