feat (login page): add a sign in / log in page

This commit is contained in:
Pierre Ryssen
2026-03-03 14:47:07 +01:00
parent 7905adb55d
commit 53c5d952b5
19 changed files with 1756 additions and 50 deletions

View File

@@ -2,16 +2,30 @@
import { useEffect } from "react";
import { useRouter } from "next/navigation";
import { useSession } from "next-auth/react";
import Sidebar from "@/components/Sidebar";
export default function AuthLayout({ children }: { children: React.ReactNode }) {
const { status } = useSession();
const router = useRouter();
useEffect(() => {
if (sessionStorage.getItem("wyview_auth") !== "true") {
if (status === "unauthenticated") {
router.push("/");
}
}, [router]);
}, [status, router]);
if (status === "loading") {
return (
<div className="min-h-screen bg-[#0a0d0f] flex items-center justify-center">
<span className="text-[#4aff8c]/40 font-mono text-xs tracking-widest animate-pulse">
CHARGEMENT...
</span>
</div>
);
}
if (status !== "authenticated") return null;
return (
<div className="flex min-h-screen">