ADD: added basic backend function plus a mockup for a cli interface

This commit is contained in:
2025-12-13 21:44:48 +01:00
parent c6de2481e6
commit a047d57824
21 changed files with 657 additions and 51 deletions

View File

@@ -0,0 +1,10 @@
import { Navigate } from "react-router-dom";
import { useAuth } from "../components/AuthContext";
import type { JSX } from 'react';
const ProtectedRoute = ({ children }: { children: JSX.Element }) => {
const { token } = useAuth() as { token?: string | null };
return token ? children : <Navigate to="/" />;
};
export default ProtectedRoute;