File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ dependencies = [
1515 " bcrypt>=4.2.0" ,
1616 " fastapi>=0.115.4" ,
1717 " gunicorn>=23.0.0" ,
18- " passlib>=1.7.4 " ,
18+ " pwdlib[bcrypt]>=0.3.0 " ,
1919 " python-jose[cryptography]>=3.3.0" ,
2020 " python-multipart>=0.0.17" ,
2121 " uvicorn>=0.32.0" ,
Original file line number Diff line number Diff line change 66from fastapi import APIRouter , Depends , HTTPException
77from fastapi .security import OAuth2PasswordBearer , OAuth2PasswordRequestForm
88from jose import JWTError , jwt
9- from passlib .context import CryptContext
9+ from pwdlib import PasswordHash
10+ from pwdlib .hashers .bcrypt import BcryptHasher
1011from pydantic import BaseModel
1112
1213from svc .core import config
@@ -30,7 +31,7 @@ class UserInDB(User):
3031 hashed_password : str
3132
3233
33- pwd_context = CryptContext ( schemes = [ "bcrypt" ], deprecated = "auto" )
34+ pwd_context = PasswordHash ([ BcryptHasher ()] )
3435oauth2_scheme = OAuth2PasswordBearer (tokenUrl = "/token" )
3536router = APIRouter ()
3637
You can’t perform that action at this time.
0 commit comments