File size: 538 Bytes
2d80150
 
 
 
 
 
 
 
 
 
 
 
 
 
a862ee6
2d80150
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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'],
            # email whitelist
)