Text_input type Password is leaking in the DOM

I’m having a problem when I use password = st.text_input(label=‘Enter your password’, type=‘password’). Even following the recommendations of the documentation the password is being exposed in the DOM, showing this warning:

image

Whenever I click st.form_submit_button it sends the data and the input value is shown in the warming.

Here is the code:

import streamlit as st

if __name__ == "__main__":
    # Create a title and sub-title
    st.write("Test")

    with st.form(key='my_form'):
        password = st.text_input(label='Enter your password', type='password')
        submit_button = st.form_submit_button(label='Submit')

I’m using Python 3.10.6 with wsl2. I tested with versions 1.26 and 1.27 of streamlit.

Hi @johann_pires , is this only on community cloud or also on local streamlit?

local too.
I hope I didn’t put the question in the wrong topic.

Thanks for the reply. Could you make a bug report here:

so we can track and make sure that we fix it when the time comes?

Hey @johann_pires ,

While this gets resolved, I would advise that you create a custom component using the inbuilt JS and HTML functionality.

In the past, I used flask and custom components for the login systems. Hope this helps!