Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -6,6 +6,29 @@ import uuid
|
|
6 |
import firebase_admin
|
7 |
from firebase_admin import credentials, firestore
|
8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
# 🔐 Firebase setup
|
10 |
if not firebase_admin._apps:
|
11 |
cred = credentials.Certificate("firebase-service-account.json")
|
|
|
6 |
import firebase_admin
|
7 |
from firebase_admin import credentials, firestore
|
8 |
|
9 |
+
# ------------------ Authentication ------------------
|
10 |
+
VALID_USERS = {
|
11 |
+
"[email protected]": "Pass.123",
|
12 |
+
}
|
13 |
+
|
14 |
+
def login():
|
15 |
+
st.title("🔐 Login Required")
|
16 |
+
email = st.text_input("Email")
|
17 |
+
password = st.text_input("Password", type="password")
|
18 |
+
if st.button("Login"):
|
19 |
+
if VALID_USERS.get(email) == password:
|
20 |
+
st.session_state.authenticated = True
|
21 |
+
st.rerun()
|
22 |
+
else:
|
23 |
+
st.error("❌ Incorrect email or password.")
|
24 |
+
|
25 |
+
if "authenticated" not in st.session_state:
|
26 |
+
st.session_state.authenticated = False
|
27 |
+
|
28 |
+
if not st.session_state.authenticated:
|
29 |
+
login()
|
30 |
+
st.stop()
|
31 |
+
|
32 |
# 🔐 Firebase setup
|
33 |
if not firebase_admin._apps:
|
34 |
cred = credentials.Certificate("firebase-service-account.json")
|