Update app.py
Browse files
app.py
CHANGED
|
@@ -44,18 +44,10 @@ 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 |
-
# Check if the password is correct by reauthenticating the user
|
| 48 |
-
user = auth.sign_in_with_email_and_password(email, password)
|
| 49 |
# The user is successfully fetched, meaning the email and password are valid.
|
| 50 |
return True, user
|
| 51 |
-
except
|
| 52 |
-
print(f"
|
| 53 |
-
return False, None
|
| 54 |
-
except firebase_admin.auth.AuthError as e:
|
| 55 |
-
if e.code == 'wrong-password':
|
| 56 |
-
print("Invalid password error")
|
| 57 |
-
else:
|
| 58 |
-
print(f"Authentication error: {str(e)}")
|
| 59 |
return False, None
|
| 60 |
|
| 61 |
# Sign-up Functionality
|
|
|
|
| 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
|