combat_frontend / auth.py
Junaidb's picture
Create auth.py
2d80150 verified
raw
history blame
562 Bytes
import yaml
from yaml.loader import SafeLoader
import streamlit_authenticator as stauth
# Load config from YAML
with open('config.yaml') as file:
config = yaml.load(file, Loader=SafeLoader)
# Define the authenticator
authenticator = stauth.Authenticate(
config['credentials'], # contains usernames/passwords
config['cookie']['name'], # name of the login session cookie
config['cookie']['key'], # secret key for signing the cookie
config['cookie']['expiry_days'],
config['preauthorized'] # email whitelist
)