mkhorasani / Streamlit-Authenticator

A secure authentication module to validate user credentials in a Streamlit application.
Apache License 2.0
1.38k stars 229 forks source link

widget after button then not work #93

Closed lcg29 closed 9 months ago

lcg29 commented 9 months ago

For example, reset passwords:

    if st.button('reset passwords', type="primary"):
        try:
            if authenticator.reset_password(st.session_state["username"], 'Reset password'):
                st.success('reset success ')
        except Exception as e:
            st.error(e)

with no work and no 'reset success '

If I delete st.button, it will work

        try:
            if authenticator.reset_password(st.session_state["username"], 'Reset password'):
                st.success('reset ')
        except Exception as e:
            st.error(e)
mkhorasani commented 9 months ago

When you use the reset password widget it will automatically save the new hashed password to the config dictionary you passed to the authenticator object when you first created it. The last step simply ensures that the config dictionary is saved to disk as a config file.

thisismygitrepo commented 8 months ago

What if I have a database to update the password instead of config file? I need that button.

MaveriQ commented 3 months ago

@thisismygitrepo did you find a workaround?