Skip to content

Commit 730c04e

Browse files
committed
Keep compatibility with passwords hashed using bcrypt
1 parent caea35d commit 730c04e

3 files changed

Lines changed: 73 additions & 5 deletions

File tree

backend/app/core/security.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,17 @@
33

44
import jwt
55
from pwdlib import PasswordHash
6+
from pwdlib.hashers.argon2 import Argon2Hasher
7+
from pwdlib.hashers.bcrypt import BcryptHasher
68

79
from app.core.config import settings
810

9-
password_hash = PasswordHash.recommended()
11+
password_hash = PasswordHash(
12+
(
13+
Argon2Hasher(),
14+
BcryptHasher(),
15+
)
16+
)
1017

1118

1219
ALGORITHM = "HS256"

backend/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ dependencies = [
1818
"pydantic-settings<3.0.0,>=2.2.1",
1919
"sentry-sdk[fastapi]<2.0.0,>=1.40.6",
2020
"pyjwt<3.0.0,>=2.8.0",
21-
"pwdlib[argon2]>=0.2.1",
21+
"pwdlib[argon2,bcrypt]>=0.2.1",
2222
]
2323

2424
[tool.uv]

backend/uv.lock

Lines changed: 64 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)