mkhorasani / Streamlit-Authenticator

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

Get passwords from Database #15

Closed aYoHoldings closed 2 years ago

aYoHoldings commented 2 years ago

Hi,

I am trying to get my passwords with a select query from the database, but when I pass it to the Hasher module, I get an error:

File "/home/appuser/venv/lib/python3.9/site-packages/streamlit_authenticator/init.py", line 37, in hash

return bcrypt.hashpw(password.encode(), bcrypt.gensalt()).decode()

AttributeError: 'tuple' object has no attribute 'encode'

What type of object should be passed to the Hasher module?

I am very new to python and will appreciate your help tremendously.

mkhorasani commented 2 years ago

Hi,

Please pass your passwords ONLY as a list of strings, i.e. ['123', '456'] not as a tuple or any other data structure.