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

Modified version to accept dict or pymongo.collection.Collection as credentials #143

Closed livius147 closed 3 months ago

livius147 commented 3 months ago

Dear developers,

recently I tried to use the streamlit-authenticator-mongo project to use a backend with mongodb, but the code is buggy and it is not completely compatible with the your project. So I decided to make some modifications to your original project to maintain compatibility with the credentials passed as dict and to add the possibility to pass a MongoDB Collection object. I made some tests and it seems to work fine.

Each document in the mongo db is as follows: {username : , data: { name: <>, password: <>, email: <>, logged_in: <>} } Same fields of the original dict are used.

If you are interested in my modifications, I send you the authenticate.py code, the only source I have modified. If it is ok for you, merge it on your code.

Regards. Livius authenticate.zip

mkhorasani commented 3 months ago

Thank you!