RajaThor commited on
Commit
b0d8fc8
·
verified ·
1 Parent(s): 74c4208

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -44,12 +44,17 @@ shape_predictor = dlib.shape_predictor(shape_predictor_path)
44
  def authenticate_user(email, password):
45
  try:
46
  user = auth.get_user_by_email(email)
 
 
47
  # The user is successfully fetched, meaning the email and password are valid.
48
  return True, user
49
  except auth.AuthError as e:
50
  print(f"Authentication error: {str(e)}")
51
  return False, None
52
-
 
 
 
53
  # Sign-up Functionality
54
  def create_user(email, password):
55
  try:
 
44
  def authenticate_user(email, password):
45
  try:
46
  user = auth.get_user_by_email(email)
47
+ # Check if the password is correct
48
+ auth.verify_password(password, user.password)
49
  # The user is successfully fetched, meaning the email and password are valid.
50
  return True, user
51
  except auth.AuthError as e:
52
  print(f"Authentication error: {str(e)}")
53
  return False, None
54
+ except Exception as e:
55
+ print(f"Password verification error: {str(e)}")
56
+ return False, None
57
+
58
  # Sign-up Functionality
59
  def create_user(email, password):
60
  try: