Update app.py
Browse files
app.py
CHANGED
|
@@ -353,34 +353,35 @@ def authenticate_user_ui():
|
|
| 353 |
|
| 354 |
with c32:
|
| 355 |
st.title("Insta's EYE")
|
| 356 |
-
st.
|
| 357 |
-
|
| 358 |
-
|
| 359 |
-
|
| 360 |
-
|
| 361 |
-
|
| 362 |
-
|
| 363 |
-
|
| 364 |
-
|
| 365 |
-
|
| 366 |
-
|
| 367 |
-
|
| 368 |
-
|
| 369 |
-
|
| 370 |
-
if not email or not password:
|
| 371 |
-
st.error("Please enter both email and password.")
|
| 372 |
-
else:
|
| 373 |
-
success, user = authenticate_user(email, password)
|
| 374 |
-
if success:
|
| 375 |
-
st.session_state.auth_state["user"] = user
|
| 376 |
-
st.session_state.auth_state["signed_in"] = True
|
| 377 |
-
st.success("Authentication successful! You can now manage your set of images and profiles.")
|
| 378 |
-
main()
|
| 379 |
else:
|
| 380 |
-
|
| 381 |
-
|
| 382 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 383 |
confirm_password = st.text_input("Confirm Password", type="password", help="Re-enter your password for confirmation")
|
|
|
|
| 384 |
if st.button("Sign-Up"):
|
| 385 |
if not email or not password or not confirm_password:
|
| 386 |
st.error("Please fill all the fields.")
|
|
|
|
| 353 |
|
| 354 |
with c32:
|
| 355 |
st.title("Insta's EYE")
|
| 356 |
+
tabs = st.tabs(["Login", "Sign-Up"])
|
| 357 |
+
|
| 358 |
+
if tabs == "Login":
|
| 359 |
+
if st.session_state.auth_state["signed_in"]:
|
| 360 |
+
st.sidebar.button("Sign Out", on_click=logout)
|
| 361 |
+
st.title("Welcome!")
|
| 362 |
+
main()
|
| 363 |
+
else:
|
| 364 |
+
email = st.text_input("Enter Email", help="Enter your email address")
|
| 365 |
+
password = st.text_input("Enter Password", type="password", help="Enter your password")
|
| 366 |
+
|
| 367 |
+
if st.button("Login"):
|
| 368 |
+
if not email or not password:
|
| 369 |
+
st.error("Please enter both email and password.")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 370 |
else:
|
| 371 |
+
success, user = authenticate_user(email, password)
|
| 372 |
+
if success:
|
| 373 |
+
st.session_state.auth_state["user"] = user
|
| 374 |
+
st.session_state.auth_state["signed_in"] = True
|
| 375 |
+
st.success("Authentication successful! You can now manage your set of images and profiles.")
|
| 376 |
+
main()
|
| 377 |
+
else:
|
| 378 |
+
st.error("Authentication failed. Please check your email and password.")
|
| 379 |
+
|
| 380 |
+
elif tabs == "Sign-Up":
|
| 381 |
+
email = st.text_input("Enter Email", help="Enter your email address")
|
| 382 |
+
password = st.text_input("Enter Password", type="password", help="Enter your password")
|
| 383 |
confirm_password = st.text_input("Confirm Password", type="password", help="Re-enter your password for confirmation")
|
| 384 |
+
|
| 385 |
if st.button("Sign-Up"):
|
| 386 |
if not email or not password or not confirm_password:
|
| 387 |
st.error("Please fill all the fields.")
|