Gregniuki commited on
Commit
f442212
1 Parent(s): 6c20a60

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -302,8 +302,8 @@ def verify_password(plain_password, hashed_password):
302
  def get_password_hash(password):
303
  return pwd_context.hash(password)
304
 
305
- def authenticate_user(db: Session, username: str, password: str):
306
- user = db.query(User).filter(User.username == username).first()
307
  if not user or not verify_password(password, user.hashed_password):
308
  return False
309
  return user
 
302
  def get_password_hash(password):
303
  return pwd_context.hash(password)
304
 
305
+ def authenticate_user(db: Session, email: str, password: str):
306
+ user = db.query(User).filter(User.email == username).first()
307
  if not user or not verify_password(password, user.hashed_password):
308
  return False
309
  return user