mkhorasani / Streamlit-Authenticator

A secure authentication module to manage user access in a Streamlit application.
Other
1.66k stars 258 forks source link

Login twice while using st.navigation/st.page #204

Closed dgaoh closed 2 months ago

dgaoh commented 2 months ago

while call login function via st.navigation/st.page, users have to login twice, it's reproducible

def logmein():
    # print('Before login: >>>\n ',st.session_state)
    # Creating a login widget
    try:
        authenticator.login()
    except LoginError as e:
        st.error(e)
    # print('After login: >>>\n ',st.session_state)
    if st.session_state["authentication_status"]:
        authenticator.logout()
        st.write(f'Welcome *{st.session_state["name"]}*')
        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 enter your username and password')

pg = st.navigation([st.Page(logmein)])

pg.run()
dgaoh commented 2 months ago

login twice, meaning: input username/password twice to get once successful login.

  1. In 1st attempt, After inputting username/password, clicking on the "login" formbutton, UI remains on login form without any changes
lkdhy commented 2 months ago

Maybe your problem is the same as that in https://github.com/mkhorasani/Streamlit-Authenticator/issues/184? Chances are the new release is about to come.

mkhorasani commented 2 months ago

Please follow #184 for updates. I will close this issue.