I am running the app locally.
st.session_state.authenticated = False
st.set_page_config(layout=“wide”)def main():
# Check if user is authenticated if st.session_state.authenticated: show_main_pages() else: show_login_page()
def show_login_page():
> st.title("Log In")
> email = st.text_input('Email Address')
> password = st.text_input('Password', type='password')
> if st.button("Sign In"):
> response = sign_in2(email, password)
> st.write(response)
> if response == "Signed in successfully": # Update session state if login successful
> st.session_state.authenticated = True
> main()
The session state authentication is initialised as False and the main() function dictates that in such cases the login page should show. So when I boot up Streamlit, I am shown the log in page.
After successfuly signing in, Streamlit redirects to the main pages, however, the issue is that the login page still shows at the very top (the show_main_pages() content is shown below it).
How can I stop the login page data showing after I have successfully logged in?
I have tried to replace the last line (“main()”) of show_login_page() with “show_main_pages()” itself directly but this results in same issue.