File size: 1,327 Bytes
378ebdc
 
 
1066eaf
378ebdc
 
 
 
1066eaf
 
378ebdc
 
 
 
 
 
 
 
 
1066eaf
378ebdc
 
 
 
 
1066eaf
378ebdc
 
 
 
 
 
1066eaf
378ebdc
 
1066eaf
378ebdc
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# import streamlit as st
# import streamlit_authenticator as stauth
# import os

# admin_email = os.getenv("ADMIN_EMAIL")
# admin_pass = os.getenv("ADMIN_PASS")
# admin_username = os.getenv("ADMIN_USERNAME")
# cookie_signature_key = os.getenv("COOKIE_SIGNATURE_KEY")


# credentials = {
#     'usernames': {
#         'impreccable': {
#             'email': admin_email,
#             'name': admin_username,
#             'password': admin_pass 
#         }
#     }
# }

# cookie_config = {
#     'name': 'some_cookie_name',
#     'key': cookie_signature_key,
#     'expiry_days': 30
# }
    
# authenticator = stauth.Authenticate(
#     credentials,
#     cookie_config['name'],
#     cookie_config['key'],
#     cookie_config['expiry_days']
# )

# try:
#     authenticator.login()

#     if st.session_state['authentication_status']:
#         st.session_state['logged_in'] = True
#         authenticator.logout()
#         st.write(f'Welcome *{st.session_state["name"]}*')
#         st.title('Some content')
#     elif st.session_state['authentication_status'] is False:
#         st.error('Username/password is incorrect')
#     elif st.session_state['authentication_status'] is None:
#         st.warning('Please enter your username and password')
# except KeyError:
#     st.error('Please check your configuration file')