RajaThor commited on
Commit
e01621b
·
verified ·
1 Parent(s): a07ca8b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -2
app.py CHANGED
@@ -354,12 +354,12 @@ def authenticate_user_ui():
354
  st.title("Welcome!")
355
  main()
356
  else:
357
- option = st.sidebar.radio("Select Option", ["Login", "Sign-Up"])
358
 
359
  email = st.text_input("Enter Email", help="Enter your email address")
360
- password = st.text_input("Enter Password", type="password", help="Enter your password")
361
 
362
  if option == "Login":
 
363
  if st.button("Login"):
364
  if not email or not password:
365
  st.error("Please enter both email and password.")
@@ -387,6 +387,20 @@ def authenticate_user_ui():
387
  else:
388
  st.error("User creation failed. Please try again.")
389
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
390
  # Log out user
391
  def logout():
392
  st.session_state.auth_state["user"] = None
 
354
  st.title("Welcome!")
355
  main()
356
  else:
357
+ option = st.sidebar.radio("Select Option", ["Login", "Sign-Up", "Reset Password"])
358
 
359
  email = st.text_input("Enter Email", help="Enter your email address")
 
360
 
361
  if option == "Login":
362
+ password = st.text_input("Enter Password", type="password", help="Enter your password")
363
  if st.button("Login"):
364
  if not email or not password:
365
  st.error("Please enter both email and password.")
 
387
  else:
388
  st.error("User creation failed. Please try again.")
389
 
390
+ elif option == "Reset Password":
391
+ if st.button("Send Password Reset Email"):
392
+ try:
393
+ auth.send_password_reset_email(email)
394
+ st.success("Password reset email sent. Please check your inbox.")
395
+ except Exception as e:
396
+ st.error(f"Failed to send password reset email: {str(e)}")
397
+
398
+ # Log out user
399
+ def logout():
400
+ st.session_state.auth_state["user"] = None
401
+ st.session_state.auth_state["signed_in"] = False
402
+
403
+
404
  # Log out user
405
  def logout():
406
  st.session_state.auth_state["user"] = None