Spaces:
Running
Running
fixed auth
Browse files
app.py
CHANGED
|
@@ -28,8 +28,8 @@ from io import BytesIO
|
|
| 28 |
logger = logging.getLogger(__name__)
|
| 29 |
|
| 30 |
# Local
|
| 31 |
-
from dotenv import load_dotenv
|
| 32 |
-
load_dotenv()
|
| 33 |
|
| 34 |
config = getconfig("config.cfg")
|
| 35 |
|
|
@@ -69,7 +69,7 @@ def get_azure_deployment():
|
|
| 69 |
def main():
|
| 70 |
# Temporarily set authentication to True for testing
|
| 71 |
if 'authenticated' not in st.session_state:
|
| 72 |
-
st.session_state['authenticated'] =
|
| 73 |
|
| 74 |
if st.session_state['authenticated']:
|
| 75 |
# Remove login success message for testing
|
|
@@ -228,15 +228,15 @@ def main():
|
|
| 228 |
|
| 229 |
|
| 230 |
# Comment out for testing
|
| 231 |
-
|
| 232 |
-
|
| 233 |
-
|
| 234 |
-
|
| 235 |
-
|
| 236 |
-
|
| 237 |
-
|
| 238 |
-
|
| 239 |
-
|
| 240 |
|
| 241 |
|
| 242 |
|
|
|
|
| 28 |
logger = logging.getLogger(__name__)
|
| 29 |
|
| 30 |
# Local
|
| 31 |
+
# from dotenv import load_dotenv
|
| 32 |
+
# load_dotenv()
|
| 33 |
|
| 34 |
config = getconfig("config.cfg")
|
| 35 |
|
|
|
|
| 69 |
def main():
|
| 70 |
# Temporarily set authentication to True for testing
|
| 71 |
if 'authenticated' not in st.session_state:
|
| 72 |
+
st.session_state['authenticated'] = False
|
| 73 |
|
| 74 |
if st.session_state['authenticated']:
|
| 75 |
# Remove login success message for testing
|
|
|
|
| 228 |
|
| 229 |
|
| 230 |
# Comment out for testing
|
| 231 |
+
else:
|
| 232 |
+
username = st.text_input("Username")
|
| 233 |
+
password = st.text_input("Password", type="password")
|
| 234 |
+
if st.button("Login"):
|
| 235 |
+
if validate_login(username, password):
|
| 236 |
+
st.session_state['authenticated'] = True
|
| 237 |
+
st.rerun()
|
| 238 |
+
else:
|
| 239 |
+
st.error("Incorrect username or password")
|
| 240 |
|
| 241 |
|
| 242 |
|