Hide text input box after the input

Hello,

Do you know if there is any hacky way to do that? A simple application will be the password.

password = st.text_input("Password:", value="", type="password")
# and hide the password in this command line
# follow the main application 
st.sidebar.title("Navigation")
app_mode = st.sidebar.radio("Choose a section:",  ['A', 'B'])
if password == '123':
  .....

Yes, i did it in my app.
I’m using the session state to save the user details

authenticated = False
if state.user and state.password:
    authenticated = authentication(state.user, state.password)
if authenticated:
    st.info("user authenticated")
    page = PAGES[selection]
    page.show_page(state)
else:
    st.error(auth_error_message)
    state.user = st.text_input(label="User name")
    state.password = st.text_input("Password ", type="password")
2 Likes

Thank you for the reply. Could you let me know what packages you are using?

Hello @zakk,

The relevant part of @erezrot’s code sample is session states. It’ll help you store your “logged in” flag across app reruns.

@Synode thank you! :pray: