-
Notifications
You must be signed in to change notification settings - Fork 292
Open
Labels
enhancementNew feature or requestNew feature or request
Description
| self.credentials['usernames'] = { |
You can get steamlit-authenticator to automatically save user accounts using a construct like this:
credential_store = {'usernames':shelve.open("./user_accounts.shelve")}
authenticator = stauth.Authenticate(
credentials=credential_store,
)This pairs even better with tools like zict
storage = zict.File(directory="./accounts")
utf8_to_bytes = zict.Func(lambda x: x.encode('utf8'), lambda x: x.decode('utf8'), storage)
encoder = zict.Func(yaml.safe_dump, yaml.safe_load, utf8_to_bytes)
credential_store = {'usernames':encoder}
Which will create a new yaml file for each user. You can also use sqlite, or lmdb, or even postgres transports.
But none of that works because instead of taking the actual credentials object at face value you recreate it using a standard python dict.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request