RajaThor commited on
Commit
87f64fe
·
verified ·
1 Parent(s): 52a30f4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +27 -26
app.py CHANGED
@@ -353,34 +353,35 @@ def authenticate_user_ui():
353
 
354
  with c32:
355
  st.title("Insta's EYE")
356
- st.sidebar.title("Options")
357
-
358
- if st.session_state.auth_state["signed_in"]:
359
- st.sidebar.button("Sign Out", on_click=logout)
360
- st.title("Welcome!")
361
- main()
362
- else:
363
- option = st.sidebar.radio("Select Option", ["Login", "Sign-Up"])
364
-
365
- email = st.text_input("Enter Email", help="Enter your email address")
366
- password = st.text_input("Enter Password", type="password", help="Enter your password")
367
-
368
- if option == "Login":
369
- if st.button("Login"):
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
- st.error("Authentication failed. Please check your email and password.")
381
-
382
- elif option == "Sign-Up":
 
 
 
 
 
 
 
 
 
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.")