Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -305,41 +305,6 @@ def display_about_page():
|
|
305 |
<img src="https://content.linkedin.com/content/dam/me/business/en-us/amp/brand-site/v2/bg/LI-Logo.svg.original.svg" width="100">
|
306 |
</a>
|
307 |
""", unsafe_allow_html=True)
|
308 |
-
import hmac
|
309 |
-
|
310 |
-
def check_password():
|
311 |
-
"""Returns `True` if the user entered a correct password."""
|
312 |
-
|
313 |
-
def login_form():
|
314 |
-
"""Form with widgets to collect user information."""
|
315 |
-
with st.form("Credentials"):
|
316 |
-
st.text_input("Username", key="username")
|
317 |
-
st.text_input("Password", type="password", key="password")
|
318 |
-
st.form_submit_button("Log in", on_click=password_entered)
|
319 |
-
|
320 |
-
def password_entered():
|
321 |
-
"""Checks whether a password entered by the user is correct."""
|
322 |
-
if st.session_state["username"] in st.secrets[
|
323 |
-
"passwords"
|
324 |
-
] and hmac.compare_digest(
|
325 |
-
st.session_state["password"],
|
326 |
-
st.secrets.passwords[st.session_state["username"]],
|
327 |
-
):
|
328 |
-
st.session_state["password_correct"] = True
|
329 |
-
del st.session_state["password"] # Don't store username or password.
|
330 |
-
del st.session_state["username"]
|
331 |
-
else:
|
332 |
-
st.session_state["password_correct"] = False
|
333 |
-
|
334 |
-
# Return True if the username + password is validated.
|
335 |
-
if st.session_state.get("password_correct", False):
|
336 |
-
return True
|
337 |
-
|
338 |
-
# Show inputs for username + password.
|
339 |
-
login_form()
|
340 |
-
if "password_correct" in st.session_state:
|
341 |
-
st.error("😕 User not known or password incorrect")
|
342 |
-
return False
|
343 |
|
344 |
def main():
|
345 |
st.title("Job Easz")
|
@@ -352,7 +317,7 @@ def main():
|
|
352 |
|
353 |
# Sidebar for navigation
|
354 |
st.sidebar.title("Navigation")
|
355 |
-
page = st.sidebar.radio("Go to", ["Dashboard", "Data Explorer", "About"
|
356 |
|
357 |
# Navigation logic
|
358 |
if page == "Dashboard":
|
@@ -361,13 +326,6 @@ def main():
|
|
361 |
display_data_explorer(df)
|
362 |
elif page == "About":
|
363 |
display_about_page()
|
364 |
-
elif page == "Recommender":
|
365 |
-
# Check password before accessing Recommender
|
366 |
-
if not check_password():
|
367 |
-
st.stop()
|
368 |
-
else:
|
369 |
-
# Content for authenticated users
|
370 |
-
st.write("Welcome to the Recommender system!")
|
371 |
|
372 |
|
373 |
|
|
|
305 |
<img src="https://content.linkedin.com/content/dam/me/business/en-us/amp/brand-site/v2/bg/LI-Logo.svg.original.svg" width="100">
|
306 |
</a>
|
307 |
""", unsafe_allow_html=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
308 |
|
309 |
def main():
|
310 |
st.title("Job Easz")
|
|
|
317 |
|
318 |
# Sidebar for navigation
|
319 |
st.sidebar.title("Navigation")
|
320 |
+
page = st.sidebar.radio("Go to", ["Dashboard", "Data Explorer", "About"])
|
321 |
|
322 |
# Navigation logic
|
323 |
if page == "Dashboard":
|
|
|
326 |
display_data_explorer(df)
|
327 |
elif page == "About":
|
328 |
display_about_page()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
329 |
|
330 |
|
331 |
|