Spaces:
Sleeping
Sleeping
suhail commited on
Commit ·
8869147
1
Parent(s): 9ff393a
somting
Browse files- src/core/security.py +0 -6
src/core/security.py
CHANGED
|
@@ -10,17 +10,11 @@ pwd_context = CryptContext(schemes=["bcrypt"], deprecated="auto")
|
|
| 10 |
|
| 11 |
|
| 12 |
def hash_password(password: str) -> str:
|
| 13 |
-
"""
|
| 14 |
-
Hash a password using bcrypt.
|
| 15 |
-
|
| 16 |
-
bcrypt has a hard limit of 72 bytes.
|
| 17 |
-
"""
|
| 18 |
if len(password.encode("utf-8")) > 72:
|
| 19 |
raise HTTPException(
|
| 20 |
status_code=status.HTTP_400_BAD_REQUEST,
|
| 21 |
detail="Password must be at most 72 characters"
|
| 22 |
)
|
| 23 |
-
|
| 24 |
return pwd_context.hash(password)
|
| 25 |
|
| 26 |
|
|
|
|
| 10 |
|
| 11 |
|
| 12 |
def hash_password(password: str) -> str:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
if len(password.encode("utf-8")) > 72:
|
| 14 |
raise HTTPException(
|
| 15 |
status_code=status.HTTP_400_BAD_REQUEST,
|
| 16 |
detail="Password must be at most 72 characters"
|
| 17 |
)
|
|
|
|
| 18 |
return pwd_context.hash(password)
|
| 19 |
|
| 20 |
|