IsaacKerson commited on
Commit
02bfc9a
1 Parent(s): f408992

update authenticator.py

Browse files
Files changed (2) hide show
  1. authenticator.py +1 -42
  2. pages/login.py +0 -1
authenticator.py CHANGED
@@ -2,7 +2,6 @@ import jwt
2
  import yaml
3
  import bcrypt
4
  import streamlit as st
5
- from yaml.loader import SafeLoader
6
  from datetime import datetime, timedelta
7
  import extra_streamlit_components as stx
8
 
@@ -222,44 +221,4 @@ class Authenticate:
222
  st.session_state['logout'] = True
223
  st.session_state['name'] = None
224
  st.session_state['username'] = None
225
- st.session_state['authentication_status'] = None
226
-
227
- # if not _RELEASE:
228
- # with open('../config.yaml') as file:
229
- # config = yaml.load(file, Loader=SafeLoader)
230
-
231
- # hashed_passwords = Hasher(config['credentials']['passwords']).generate()
232
-
233
- # authenticator = Authenticate(
234
- # config['credentials']['names'],
235
- # config['credentials']['usernames'],
236
- # hashed_passwords,
237
- # config['cookie']['name'],
238
- # config['cookie']['key'],
239
- # cookie_expiry_days=30
240
- # )
241
-
242
- # name, authentication_status, username = authenticator.login('Login', 'main')
243
-
244
- # if authentication_status:
245
- # authenticator.logout('Logout', 'main')
246
- # st.write('Welcome *%s*' % (name))
247
- # st.title('Some content')
248
- # elif authentication_status == False:
249
- # st.error('Username/password is incorrect')
250
- # elif authentication_status == None:
251
- # st.warning('Please enter your username and password')
252
-
253
- # Alternatively you use st.session_state['name'] and
254
- # st.session_state['authentication_status'] to access the name and
255
- # authentication_status.
256
-
257
- #authenticator.login('Login', 'main')
258
-
259
- #if st.session_state['authentication_status']:
260
- # st.write('Welcome *%s*' % (st.session_state['name']))
261
- # st.title('Some content')
262
- #elif st.session_state['authentication_status'] == False:
263
- # st.error('Username/password is incorrect')
264
- #elif st.session_state['authentication_status'] == None:
265
- # st.warning('Please enter your username and password')
 
2
  import yaml
3
  import bcrypt
4
  import streamlit as st
 
5
  from datetime import datetime, timedelta
6
  import extra_streamlit_components as stx
7
 
 
221
  st.session_state['logout'] = True
222
  st.session_state['name'] = None
223
  st.session_state['username'] = None
224
+ st.session_state['authentication_status'] = None
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
pages/login.py CHANGED
@@ -1,4 +1,3 @@
1
- from pages.utils import db_connect
2
  import streamlit as st
3
  import yaml
4
 
 
 
1
  import streamlit as st
2
  import yaml
3