Update app.py
Browse files
app.py
CHANGED
|
@@ -2,7 +2,6 @@ import os
|
|
| 2 |
import streamlit as st
|
| 3 |
import firebase_admin
|
| 4 |
from firebase_admin import credentials, db, auth, firestore
|
| 5 |
-
from firebase_admin.auth import AuthError
|
| 6 |
import face_recognition
|
| 7 |
from PIL import Image
|
| 8 |
import numpy as np
|
|
@@ -49,11 +48,14 @@ def authenticate_user(email, password):
|
|
| 49 |
auth.verify_password(password, user.password)
|
| 50 |
# The user is successfully fetched, meaning the email and password are valid.
|
| 51 |
return True, user
|
| 52 |
-
except
|
| 53 |
-
print(f"
|
|
|
|
|
|
|
|
|
|
| 54 |
return False, None
|
| 55 |
except Exception as e:
|
| 56 |
-
print(f"
|
| 57 |
return False, None
|
| 58 |
|
| 59 |
# Sign-up Functionality
|
|
|
|
| 2 |
import streamlit as st
|
| 3 |
import firebase_admin
|
| 4 |
from firebase_admin import credentials, db, auth, firestore
|
|
|
|
| 5 |
import face_recognition
|
| 6 |
from PIL import Image
|
| 7 |
import numpy as np
|
|
|
|
| 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.UserNotFoundError as e:
|
| 52 |
+
print(f"User not found error: {str(e)}")
|
| 53 |
+
return False, None
|
| 54 |
+
except firebase_admin.auth.InvalidPasswordError as e:
|
| 55 |
+
print(f"Invalid password error: {str(e)}")
|
| 56 |
return False, None
|
| 57 |
except Exception as e:
|
| 58 |
+
print(f"Authentication error: {str(e)}")
|
| 59 |
return False, None
|
| 60 |
|
| 61 |
# Sign-up Functionality
|