mkhorasani / Streamlit-Authenticator

A secure authentication module to manage user access in a Streamlit application.
Other
1.56k stars 248 forks source link

Can I block a new login, when a user is already logged in? #40

Closed alicjagrocholska closed 8 months ago

alicjagrocholska commented 1 year ago

Hello, I have a streamlit webapp that uses streamlit-authenticator and it works just fine, but we have seen some 'collisions' when two users are logged in a the same time (same variable names, different values, erase each other temporary files, and so on). Is there a way to block the new login to be sure that only one user can login at the same time?

mkhorasani commented 1 year ago

Hi, are the users logged in at the same time on the same device? Or are they logged in on different devices?

alicjagrocholska commented 1 year ago

They are logged in different devices, and sometimes working with the same files and the same variables names (but different values/dates, for example one could be doing a weekly report and the other one a monthly report of the same thing).

mkhorasani commented 1 year ago

I see. Well, I can definitely implement a feature that would disallow a second user from logging in with the same credentials while another user is already logged in. I will leave this issue open until I address this issue in a future release. Thank you for pointing this out!

alicjagrocholska commented 1 year ago

Thank you!

mabusdogma commented 1 year ago

+1! I'm looking forward for this implementation too!

ghost commented 1 year ago

Oh yes, i was looking into this as well, i think a lot of us would be happy if this option is available.

mkhorasani commented 8 months ago

Hi @alicjagrocholska, this feature has been implemented in release v0.3.1. You can now pass a max_concurrent_users number to the login widget to limit the number of users logged in at the same time.