Add user authentication and Active Directory management features. Includes a new admin UI and Swagger API documentation.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 705f2157-ef97-4fbd-89e4-8c7f2ecaea90
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/7ed01c5f-a82d-405a-b728-b2e3d127c60c/e9f0a10f-e323-455c-82c9-1da4a687f20e.jpg
This commit is contained in:
alphaeusmote
2025-04-08 01:55:16 +00:00
parent e871381332
commit 3c7d1c1f9c
36 changed files with 6333 additions and 535 deletions
+37
View File
@@ -0,0 +1,37 @@
import { useAuth } from "@/hooks/use-auth";
import { Loader2 } from "lucide-react";
import { Redirect, Route } from "wouter";
export function ProtectedRoute({
path,
component: Component,
}: {
path: string;
component: () => React.JSX.Element;
}) {
const { user, isLoading } = useAuth();
if (isLoading) {
return (
<Route path={path}>
<div className="flex items-center justify-center min-h-screen">
<Loader2 className="h-8 w-8 animate-spin text-primary" />
</div>
</Route>
);
}
if (!user) {
return (
<Route path={path}>
<Redirect to="/auth" />
</Route>
);
}
return (
<Route path={path}>
<Component />
</Route>
);
}