Index: frontend/src/App.tsx
===================================================================
--- frontend/src/App.tsx	(revision cb4a1da079608fdb022036c90eb6e41f26046827)
+++ frontend/src/App.tsx	(revision 5938bc91ed6ba103319368a469dca23bdb676da9)
@@ -4,4 +4,5 @@
 import "react-toastify/dist/ReactToastify.css";
 import Sidebar from "./components/Sidebar";
+import { useAuth } from "./context/authContext";
 import AllUsers from "./pages/AllUsers";
 import LandingPage from "./pages/LandingPage";
@@ -12,6 +13,7 @@
 import UserDetail from "./pages/UserDetail";
 
-const Layout = () => {
-	const [isSidebarOpen, setIsSidebarOpen] = useState(true);
+const MainLayout = () => {
+	const { user } = useAuth();
+	const [isSidebarOpen, setIsSidebarOpen] = useState(!!user);
 
 	return (
@@ -43,4 +45,18 @@
 		</div>
 	);
+};
+
+const Layout = () => {
+	const { isAuthLoading } = useAuth();
+
+	if (isAuthLoading) {
+		return (
+			<div className="flex h-screen items-center justify-center bg-[#121212]">
+				<div className="w-12 h-12 border-4 border-white/10 border-t-[#1db954] rounded-full animate-spin"></div>
+			</div>
+		);
+	}
+
+	return <MainLayout />;
 };
 
