add admin page to manage private data

This commit is contained in:
Carl Zhang
2025-10-13 23:50:53 -05:00
parent c4066ed15e
commit 421d263b6b
9 changed files with 289 additions and 3 deletions

View File

@@ -0,0 +1,18 @@
# for authentication
import yaml
from yaml.loader import SafeLoader
import streamlit_authenticator as stauth
def load_authenticator():
with open('webpages/users.yaml') as f:
users = yaml.load(f, Loader=SafeLoader)
authenticator = stauth.Authenticate(
users['credentials'],
users['cookie']['name'],
users['cookie']['key'],
users['cookie']['expiry_days']
)
return authenticator