Add authentication features for admin access

- Introduce a new `auth` module with login, logout, and user verification endpoints for a single admin user.
- Update backend routes to require admin authentication for sensitive operations, enhancing security.
- Modify frontend components to include an authentication provider and gate, ensuring only authorized users can access the application.
- Implement a login page for admin access, improving user experience and security management.
- Update API request handling to redirect unauthorized users to the login page, ensuring proper access control.
This commit is contained in:
Xin Wang
2026-07-09 23:27:50 +08:00
parent d857401ef3
commit 590cb33cbd
20 changed files with 534 additions and 29 deletions

View File

@@ -22,6 +22,7 @@ from fastapi.middleware.cors import CORSMiddleware
from routes import (
assistants,
auth,
health,
knowledge_bases,
model_registry,
@@ -48,6 +49,7 @@ app.add_middleware(
)
app.include_router(health.router)
app.include_router(auth.router)
app.include_router(assistants.router)
app.include_router(knowledge_bases.router)
app.include_router(model_registry.router)