18 lines
443 B
Python
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 |