--
This commit is contained in:
6
main.py
6
main.py
@@ -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})
|
||||
|
||||
Reference in New Issue
Block a user