Update auth.py
Browse files
auth.py
CHANGED
@@ -37,6 +37,7 @@ class UserCreate(BaseModel):
|
|
37 |
email: str
|
38 |
password: str
|
39 |
confirm_password: str
|
|
|
40 |
|
41 |
def authenticate_user(db: Session, email: str, password: str):
|
42 |
# Check if the user with the provided email exists in the database
|
@@ -60,8 +61,7 @@ def register(user: UserCreate, db: Session):
|
|
60 |
if db_user:
|
61 |
raise HTTPException(status_code=400, detail="Email already registered")
|
62 |
|
63 |
-
|
64 |
-
|
65 |
# Hash the password
|
66 |
hashed_password = pwd_context.hash(user.password)
|
67 |
|
|
|
37 |
email: str
|
38 |
password: str
|
39 |
confirm_password: str
|
40 |
+
pwd_context = CryptContext(schemes=["bcrypt"], deprecated="auto")
|
41 |
|
42 |
def authenticate_user(db: Session, email: str, password: str):
|
43 |
# Check if the user with the provided email exists in the database
|
|
|
61 |
if db_user:
|
62 |
raise HTTPException(status_code=400, detail="Email already registered")
|
63 |
|
64 |
+
|
|
|
65 |
# Hash the password
|
66 |
hashed_password = pwd_context.hash(user.password)
|
67 |
|