Disable concurrent logins for Basic Auth

Hello @warrenon,

Welcome to the community!

I dont use the BasicAuth method, I use Flask-Login. With Flask-Login, your user has a session cookie that is tied with their username after logging in.

What you can do is then store the session info along with the username in a database, and then check to make sure that their session is the last active one with their requests. When they log in, you can either have them force the other one off automatically, or prompt them to confirm.

Here is a link to a flow using Flask Login:

For this, you will need to be using Dash Pages, which isnt difficult to implement.

1 Like