mkhorasani / Streamlit-Authenticator

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

gatherUsageStats = false prevents cookie login #133

Closed PlebeiusGaragicus closed 3 months ago

PlebeiusGaragicus commented 4 months ago

I have been a very happy user of this repo for months - automatically logging in with a cookie is SO nice!

I just noticed some odd behaviour that took me several hours to debug today.

If you edit your .streamlit/config.toml to disable gathering of usage stats:

[browser]
gatherUsageStats = false

Then 9/10 times the authenticator = stauth.Authenticate(...) will not find the cookies and require that odd fix of placing a sleep() call afterwards.

Anyway - the sleep() fix was not consistent across devices and when run on localhost vs hosted. This was EXTREMELY disappointing and I thought there must have been some update to this repo that broke my site. I was worried I'd have to find another solution.

Nope... I reverted gatherUsageStats = true and my code was fixed instantly.

If anything, can we explain this behaviour or, in some way, mitigate? I'd rather not have usage data collected one core goal of making a self-hosted streamlit app is privacy...

jurest82 commented 4 months ago

Could you please provide the full error?

PlebeiusGaragicus commented 3 months ago

I think the mistake was on my end - I'd like to close this issue.