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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +23 -1
app.py CHANGED
@@ -548,11 +548,31 @@ def display_tour_steps(steps):
548
  st.markdown(f"## {step['title']}")
549
  st.write(step['content'])
550
  st.markdown("---")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
551
 
552
  # Update the main function to include the feedback option
553
  def main():
554
  st.sidebar.title("Options")
555
- option = st.sidebar.radio("Select Option", ["Recognize Face", "Add Person", "Recognize Face (Optimal)", "Delete Person", "Tour Guide", "Feedback", "Messaging", "History", "Delete User"])
556
 
557
  if option == "Recognize Face":
558
  recognize_face_ui()
@@ -572,6 +592,8 @@ def main():
572
  display_history(st.session_state.auth_state["user"].email)
573
  elif option == "Delete User":
574
  delete_user_ui()
 
 
575
 
576
  # Run the tour guide
577
  if __name__ == "__main__":
 
548
  st.markdown(f"## {step['title']}")
549
  st.write(step['content'])
550
  st.markdown("---")
551
+
552
+ # start of reset password
553
+ def reset_password(email):
554
+ try:
555
+ # Send password reset email
556
+ auth.generate_password_reset_link(email)
557
+ return f"Password reset email sent to {email}. Please check your inbox."
558
+ except Exception as e:
559
+ return f"Failed to send password reset email: {str(e)}"
560
+
561
+ def reset_password_ui():
562
+ st.title("Reset Password")
563
+ email = st.text_input("Enter Email", help="Enter the email address for password reset")
564
+ if st.button("Send Reset Email"):
565
+ if not email:
566
+ st.error("Please enter an email address.")
567
+ else:
568
+ result = reset_password(email)
569
+ st.write(result)
570
+ # end of reset password
571
 
572
  # Update the main function to include the feedback option
573
  def main():
574
  st.sidebar.title("Options")
575
+ option = st.sidebar.radio("Select Option", ["Recognize Face", "Add Person", "Recognize Face (Optimal)", "Delete Person", "Tour Guide", "Feedback", "Messaging", "History", "Delete User", "Reset Password"])
576
 
577
  if option == "Recognize Face":
578
  recognize_face_ui()
 
592
  display_history(st.session_state.auth_state["user"].email)
593
  elif option == "Delete User":
594
  delete_user_ui()
595
+ elif option == "Reset Password":
596
+ reset_password_ui()
597
 
598
  # Run the tour guide
599
  if __name__ == "__main__":