fix(auth): truncate password to 72 chars to prevent bcrypt 500 error

This commit is contained in:
Sagnik
2026-04-18 22:22:10 +05:30
parent 51d7ae4aa2
commit 9b176bb084

View File

@@ -39,7 +39,8 @@ def hash_password(plain: str) -> str:
def verify_password(plain: str, hashed: str) -> bool:
return pwd_context.verify(plain, hashed)
# Truncate to 72 bytes to prevent bcrypt 500 errors
return pwd_context.verify(plain[:72], hashed)
# ── JWT helpers ───────────────────────────────────────────────────────────────