diff --git a/hosting/src/app/(protected)/layout.tsx b/hosting/src/app/(protected)/layout.tsx index 8e04bd01..56371805 100644 --- a/hosting/src/app/(protected)/layout.tsx +++ b/hosting/src/app/(protected)/layout.tsx @@ -2,11 +2,19 @@ import CmsLayout from "@/components/Layouts/CmsLayout"; import React from "react"; +import {useAuthentication} from "@/hooks/useAuthentication"; +import {redirect} from "next/navigation"; interface ProtectedLayoutProps { children: React.ReactNode; } export default function ProtectedLayout({children}: ProtectedLayoutProps) { + const {isSignedIn} = useAuthentication(); + + if (isSignedIn === false) { + redirect("/"); + } + return {children}; }