RajaThor commited on
Commit
6469080
·
verified ·
1 Parent(s): f165c69

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -2
app.py CHANGED
@@ -428,6 +428,7 @@ def tour_guide_ui():
428
  with st.expander("Buttons"):
429
  st.write("Click on these buttons to perform actions like adding a person or recognizing a face.")
430
 
 
431
  def authenticate_user_ui():
432
  # Display logo and title
433
  c30, c31, c32 = st.columns([0.2, 0.1, 3])
@@ -447,12 +448,12 @@ def authenticate_user_ui():
447
  st.title("Welcome!")
448
  main()
449
  else:
450
- option = st.sidebar.radio("Select Option", ["Login", "Sign-Up"])
451
 
452
  email = st.text_input("Enter Email", help="Enter your email address")
453
- password = st.text_input("Enter Password", type="password", help="Enter your password")
454
 
455
  if option == "Login":
 
456
  if st.button("Login"):
457
  if not email or not password:
458
  st.error("Please enter both email and password.")
@@ -480,6 +481,14 @@ def authenticate_user_ui():
480
  else:
481
  st.error("User creation failed. Please try again.")
482
 
 
 
 
 
 
 
 
 
483
  # Log out user
484
  def logout():
485
  st.session_state.auth_state["user"] = None
 
428
  with st.expander("Buttons"):
429
  st.write("Click on these buttons to perform actions like adding a person or recognizing a face.")
430
 
431
+ #streamlit interface for user login sign-up
432
  def authenticate_user_ui():
433
  # Display logo and title
434
  c30, c31, c32 = st.columns([0.2, 0.1, 3])
 
448
  st.title("Welcome!")
449
  main()
450
  else:
451
+ option = st.sidebar.radio("Select Option", ["Login", "Sign-Up", "Reset Password"])
452
 
453
  email = st.text_input("Enter Email", help="Enter your email address")
 
454
 
455
  if option == "Login":
456
+ password = st.text_input("Enter Password", type="password", help="Enter your password")
457
  if st.button("Login"):
458
  if not email or not password:
459
  st.error("Please enter both email and password.")
 
481
  else:
482
  st.error("User creation failed. Please try again.")
483
 
484
+ elif option == "Reset Password":
485
+ if st.button("Reset Password"):
486
+ try:
487
+ auth.generate_password_reset_link(email)
488
+ st.success("Password reset link sent successfully! Please check your email.")
489
+ except Exception as e:
490
+ st.error(f"Failed to send password reset link: {str(e)}")
491
+
492
  # Log out user
493
  def logout():
494
  st.session_state.auth_state["user"] = None