From 9b176bb084345601798c27e7d1002227335f3bc8 Mon Sep 17 00:00:00 2001 From: Sagnik Date: Sat, 18 Apr 2026 22:22:10 +0530 Subject: [PATCH] fix(auth): truncate password to 72 chars to prevent bcrypt 500 error --- backend/auth/dependencies.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/auth/dependencies.py b/backend/auth/dependencies.py index 91a2ebd0..598dedcf 100644 --- a/backend/auth/dependencies.py +++ b/backend/auth/dependencies.py @@ -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 ───────────────────────────────────────────────────────────────