diff --git a/immagini/Home.jpg b/immagini/Home.jpg new file mode 100644 index 0000000..e2950c3 Binary files /dev/null and b/immagini/Home.jpg differ diff --git a/public/Home.jpg b/public/Home.jpg new file mode 100644 index 0000000..e2950c3 Binary files /dev/null and b/public/Home.jpg differ diff --git a/public/images/Home.jpg b/public/images/Home.jpg new file mode 100644 index 0000000..e2950c3 Binary files /dev/null and b/public/images/Home.jpg differ diff --git a/src/app/(main)/layout.tsx b/src/app/(main)/layout.tsx index 0416bb7..a1932f8 100644 --- a/src/app/(main)/layout.tsx +++ b/src/app/(main)/layout.tsx @@ -1,15 +1,28 @@ -export default function MainLayout({ +import { redirect } from "next/navigation"; + +import { auth } from "@/src/auth"; +import SignOutButton from "@/src/components/auth/SignOutButton"; +import Navbar from "@/src/components/Navbar"; + +export default async function MainLayout({ children, }: { children: React.ReactNode; }) { + const session = await auth(); + + if (!session?.user) { + redirect("/login"); + } + return (
Sono del layout (main)
Sono del layout root
- {session?.user ?Entra in MagRicambi con utente o email.
++ Credenziali non valide oppure utente non attivo. +
+ ) : null} + +- Credenziali non valide oppure utente non attivo. -
- ) : null} - -