This commit is contained in:
2025-11-18 00:45:51 +01:00
parent 08526cfa60
commit 2fffb4318a
2 changed files with 4 additions and 4 deletions

View File

@@ -62,9 +62,6 @@ app = FastAPI(lifespan=lifespan)
# Configure Jinja2 templates
templates = Jinja2Templates(directory=TEMPLATES_DIR)
# Add the authentication router
app.include_router(auth.router)
# Add session middleware. A secret key is required for signing the session cookie.
# We can reuse our encryption key for this, but in production you might want a separate key.
app.add_middleware(SessionMiddleware, secret_key=settings.ENCRYPTION_KEY)
@@ -72,6 +69,9 @@ app.add_middleware(SessionMiddleware, secret_key=settings.ENCRYPTION_KEY)
# Mount the 'static' directory using an absolute path for reliability
app.mount("/static", StaticFiles(directory=STATIC_DIR), name="static")
# Add the authentication router
app.include_router(auth.router)
@app.get("/")
async def read_root(request: Request):
return templates.TemplateResponse("login.html", {"request": request})