Hi,
I am using streamlit_authenticator to create a login dialog box with below code. It works fine and dialog box automatically appears when user enter the website but once user closes it and click on the login button it does not apera
@st.experimental_dialog("Login")
def show_authentication_ui():
tab1,tab2,tab3,tab4= st.tabs(["Login","Register","Forgot Password","Update Details"])
with tab1:
# Creating a login widget
try:
authenticator.login()
except LoginError as e:
st.error(e)
if st.session_state["authentication_status"]:
# authenticator.logout()
# st.write(f'Welcome *{st.session_state["name"]}*')
st.experimental_rerun()
# st.title('Some content')
elif st.session_state["authentication_status"] is False:
st.error('Username/password is incorrect')
elif st.session_state["authentication_status"] is None:
st.warning('Please Login to use GenAI for datanalysis')
with tab2:
# # Creating a new user registration widget
try:
(email_of_registered_user,
username_of_registered_user,
name_of_registered_user) = authenticator.register_user(pre_authorization=False)
if email_of_registered_user:
st.success('User registered successfully')
except RegisterError as e:
st.error(e)
I call button here
st.sidebar.button("Login",type="primary", on_click=show_authentication_ui())
Can you please help to troubleshoot?
Thanks,