ADD: added initial page with login

This commit is contained in:
hwinkel
2025-05-20 22:58:31 +02:00
parent 214ab55ad2
commit a330291456
25 changed files with 1064 additions and 35 deletions

View File

@@ -0,0 +1,8 @@
import { Navigate } from 'react-router-dom';
import { useAuth } from './AuthContext';
import { JSX } from 'react';
export default function ProtectedRoute({ children }: { children: JSX.Element }) {
const { token } = useAuth();
return token ? children : <Navigate to="/login" replace />;
}