增强JWT令牌安全性

This commit is contained in:
2025-07-15 11:23:03 +08:00
parent 03198de9c5
commit 1a3a03dd6f
5 changed files with 23 additions and 19 deletions

View File

@@ -48,7 +48,7 @@ async def login_for_access_token(
user = await authenticate_user(form_data.username, form_data.password)
if not user:
raise HTTPException(
status_code=status.HTTP_401_UNAUTHORIZED,
status_code=401,
detail="Incorrect username or password",
headers={"WWW-Authenticate": "Bearer"},
)