import type { ReactNode } from 'react'; import { useAuth } from './AuthProvider'; import LoginPage from '../pages/LoginPage'; export default function AuthGate({ children }: { children: ReactNode }) { const { loading, authRequired, authenticated } = useAuth(); if (loading) { return (

certctl

Connecting...

); } if (authRequired && !authenticated) { return ; } return <>{children}; }