diff --git a/apps/web/src/app/[locale]/(admin)/layout.tsx b/apps/web/src/app/[locale]/(admin)/layout.tsx
index dbe60c4ce..5f7fa20fb 100644
--- a/apps/web/src/app/[locale]/(admin)/layout.tsx
+++ b/apps/web/src/app/[locale]/(admin)/layout.tsx
@@ -1,6 +1,34 @@
"use client";
+import { signIn, useSession } from "next-auth/react";
+import React from "react";
+
import { StandardLayout } from "@/components/layouts/standard-layout";
+import { isSelfHosted } from "@/utils/constants";
+
+const Auth = ({ children }: { children: React.ReactNode }) => {
+ const session = useSession();
+ const isAuthenticated = !!session.data?.user.email;
+
+ React.useEffect(() => {
+ if (!isAuthenticated) {
+ signIn();
+ }
+ }, [isAuthenticated]);
+
+ if (isAuthenticated) {
+ return <>{children}>;
+ }
+
+ return null;
+};
export default function Layout({ children }: { children: React.ReactNode }) {
+ if (isSelfHosted) {
+ return (
+
+ {children}
+
+ );
+ }
return {children};
}