mkhorasani/Streamlit-Authenticator

Login twice while using st.navigation/st.page

Closed this issue ยท 3 comments

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()

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

Maybe your problem is the same as that in #184? Chances are the new release is about to come.

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