Skip to content

Commit 33fd249

Browse files
committed
Fix bcrypt 72-byte limit with bcrypt_sha256
1 parent 6f4952c commit 33fd249

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

fullapi/templates/security.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from passlib.context import CryptContext
77
from core.config import settings
88
9-
pwd_context = CryptContext(schemes=["bcrypt"], deprecated="auto")
9+
pwd_context = CryptContext(schemes=["bcrypt_sha256"], deprecated="auto")
1010
1111
1212
def verify_password(plain_password: str, hashed_password: str) -> bool:
@@ -15,7 +15,7 @@ def verify_password(plain_password: str, hashed_password: str) -> bool:
1515
1616
1717
def get_password_hash(password: str) -> str:
18-
"""Hash password using bcrypt."""
18+
"""Hash password using bcrypt with SHA256 pre-hash (no 72-byte limit)."""
1919
return pwd_context.hash(password)
2020
2121

0 commit comments

Comments
 (0)