osbm commited on
Commit
65d3c4e
·
1 Parent(s): 35b0a89

save state

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -98,7 +98,8 @@ print(get_one_from_queue("osman"))
98
 
99
 
100
 
101
-
 
102
 
103
  # login page
104
  with st.form("login"):
@@ -106,8 +107,11 @@ with st.form("login"):
106
  password = st.text_input("Password (get password from [email protected])", type="password")
107
  submitted = st.form_submit_button("Login")
108
 
 
 
 
 
109
 
110
- if submitted:
111
  if not password == os.environ.get("app_password"):
112
  st.error("The password you entered is incorrect")
113
  st.stop()
 
98
 
99
 
100
 
101
+ if 'loggedin' not in st.session_state:
102
+ st.session_state['loggedin'] = 'false'
103
 
104
  # login page
105
  with st.form("login"):
 
107
  password = st.text_input("Password (get password from [email protected])", type="password")
108
  submitted = st.form_submit_button("Login")
109
 
110
+ # save the logged in status on the machine
111
+
112
+ if submitted or st.session_state['loggedin'] == 'true':
113
+ st.session_state['loggedin'] = 'true'
114
 
 
115
  if not password == os.environ.get("app_password"):
116
  st.error("The password you entered is incorrect")
117
  st.stop()