This commit is contained in:
@@ -44,7 +44,8 @@ def get_password_hash(password: str) -> str:
|
||||
# bcrypt has a 72-byte limit, so truncate if necessary
|
||||
password_bytes = password.encode('utf-8')
|
||||
if len(password_bytes) > 72:
|
||||
password = password_bytes[:72].decode('utf-8', errors='ignore')
|
||||
logging.warning("Password exceeds bcrypt limit of 72 bytes. Truncating.")
|
||||
password = password_bytes[:70].decode('utf-8', errors='ignore')
|
||||
return pwd_context.hash(password)
|
||||
except Exception as e:
|
||||
# Handle bcrypt compatibility issues
|
||||
|
||||
Reference in New Issue
Block a user