Properly depend on security

This commit is contained in:
Nexus 2024-02-26 11:26:28 +00:00
parent 03fb84b3f8
commit 1e0a391ae5

View file

@ -69,7 +69,7 @@ app.state.last_sender_ts = datetime.utcnow()
app.state.ws_connected = Lock() app.state.ws_connected = Lock()
async def is_authenticated(credentials: Annotated[HTTPAuthCreds, security]): async def is_authenticated(credentials: Annotated[HTTPAuthCreds, Depends(security)]):
if credentials.credentials != app.state.bot.http.token: if credentials.credentials != app.state.bot.http.token:
raise HTTPException(status_code=401, detail="Invalid secret.") raise HTTPException(status_code=401, detail="Invalid secret.")