Files
Buffteks-Website/webpages/buffteks_authenticator.py
2025-10-13 23:50:53 -05:00

18 lines
443 B
Python

# 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