repositories
loading repo index
repositories
loading repo index
repository
loading code, commits, and activity
certificates
stars
latest
clone command
git clone gitlawb://did:key:z6Mkqhmm...XL9c/certificatesgit clone gitlawb://did:key:z6Mkqhmm.../certificates019974a8sync from playground15h ago| #2 | import { useAuth } from "../contexts/AuthContext"; |
| #3 |
| #4 | export default function AuthGuard() { |
| #5 | const { user, loading } = useAuth(); |
| #6 |
| #7 | if (loading) { |
| #8 | return ( |
| #9 | <div className="flex items-center justify-center min-h-screen"> |
| #10 | <div className="animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600" /> |
| #11 | </div> |
| #12 | ); |
| #13 | } |
| #14 |
| #15 | if (!user) { |
| #16 | return <Navigate to="/admin" replace />; |
| #17 | } |
| #18 |
| #19 | return <Outlet />; |
| #20 | } |
| #21 |