Skip to content

Commit

Permalink
Update bot.py
Browse files Browse the repository at this point in the history
  • Loading branch information
DoroWolf authored Jan 3, 2025
1 parent e4779bf commit 1378874
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions bots/api/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ async def auth(request: Request, response: Response):
samesite="none",
expires=datetime.now(UTC) + timedelta(hours=24)
)
return {"message": "Success", "deviceToken": jwt_token}
return {"message": "Success"}

body = await request.json()
password = body.get("password", "")
Expand All @@ -201,7 +201,7 @@ async def auth(request: Request, response: Response):
stored_password = file.read().strip()

try:
ph.verify(stored_password, password) # 验证输入的密码是否与存储的哈希匹配
ph.verify(stored_password, password)
except Exception:
raise HTTPException(status_code=401, detail="Invalid password")

Expand All @@ -222,7 +222,7 @@ async def auth(request: Request, response: Response):
expires=datetime.now(UTC) + (timedelta(days=365) if remember else timedelta(hours=24))
)

return {"message": "Success", "deviceToken": jwt_token}
return {"message": "Success"}

except HTTPException as e:
raise e
Expand Down

0 comments on commit 1378874

Please sign in to comment.