Hello blackary, thanks so much for your help!
I managed to solve the authentication problem but have a new issue.
I created a multi page streamlit app and created 2 authentication fields - one login widget for existing users and one register new user widget.
When I run the app locally, the user details (name/email/hashed passwords) are automatically written into my config.yaml file.
However, I have now deployed my app on the streamlit cloud, where the code is hosted in github. I connected streamlit to googlesheets and I am now trying to get it to write the yaml data into an empty google sheet so that I can collect the information of new users.
However, it keeps throwing up this error: ValueError: I/O operation on closed file. Please help!
this is the line that keeps throwing up the error:
I would recommend skipping the yaml step, and just writing the data directly to the sheet. You could even use the experimental GitHub - streamlit/gsheets-connection if that seems helpful. I don’t believe a worksheet will function well as an open file, which is what yaml.dump expects.
Thanks blackary! I fixed it! Not sure if this is the best method but this is what I did: I hosted the yaml config file in a google cloud storage bucket. So this means that when the app is deployed on streamlit cloud, it reads the code from github, but gets the config yaml file from GCS. And when a new user registers, it will write the new user particulars into the yaml file in GCS. If I want to view the particulars of new registered users, I’ll just need to download that yaml file from GCS.
Let me know your thoughts and if there’s a better way to do this! I am not sure if a gsheets connection would work cos I believe the config file needs to be in yml format?