Spaces:
Sleeping
Sleeping
save state
Browse files
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()
|