Update app.py
Browse files
app.py
CHANGED
|
@@ -44,11 +44,16 @@ 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):
|
|
|
|
| 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 firebase_admin.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):
|