refacto: extract app urls to constant file

This commit is contained in:
Sonny
2023-05-28 02:23:49 +02:00
parent 12a3a62d0e
commit 0d1917ebfb
11 changed files with 91 additions and 46 deletions

View File

@@ -1,13 +1,15 @@
import PATHS from "constants/paths";
import { useSession } from "next-auth/react";
import { useRouter } from "next/router";
// Component used to access to the session client side
export default function Auth({ children }) {
const router = useRouter();
const { status } = useSession({
required: true,
onUnauthenticated: () =>
router.push(
`/signin?info=${encodeURI(
`${PATHS.LOGIN}?info=${encodeURI(
"Vous devez être connecté pour accéder à cette page"
)}`
),