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

Capturing username of failed login attempts #94

Closed IndigoJay closed 5 months ago

IndigoJay commented 8 months ago

I would like to write code that blocks a user after 3 failed login attempts.

Currently, it seems like failed login attempts return the username None.

mkhorasani commented 5 months ago

Hi @IndigoJay, this feature has been implemented in release v0.3.1. You can retrieve the number of failed login attempts a user has made by accessing st.session_state['failed_login_attempts'] which returns a dictionary with the username as key and the number of failed attempts as the value.