refacto: create src dir & change project indentation to 2 spaces

This commit is contained in:
Sonny
2023-04-24 23:53:32 +02:00
parent acce5666e5
commit 426f2a52df
88 changed files with 1472 additions and 1490 deletions

View File

@@ -0,0 +1,27 @@
import { useSession } from "next-auth/react";
import { useRouter } from "next/router";
export default function Auth({ children }) {
const router = useRouter();
const { status } = useSession({
required: true,
onUnauthenticated: () =>
router.push(
`/signin?info=${encodeURI(
"Vous devez être connecté pour accéder à cette page"
)}`
),
});
if (status === "loading") {
return (
<div className="App" style={{ alignItems: "center" }}>
<p style={{ height: "fit-content" }}>
Chargement de la session en cours
</p>
</div>
);
}
return children;
}