Skip to content

Commit

Permalink
update auth
Browse files Browse the repository at this point in the history
  • Loading branch information
peterdudfield committed Nov 2, 2023
1 parent 365087d commit 3c60b96
Showing 1 changed file with 16 additions and 17 deletions.
33 changes: 16 additions & 17 deletions src/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ def check_password():
unsafe_allow_html=True,
)


auth0_logged = False
password_logged = False

Expand All @@ -54,24 +53,24 @@ def check_password():
else:
auth0_logged = True

if "password_correct" not in st.session_state:
# First run, show input for password.
st.text_input(
"Password", type="password", on_change=password_entered, key="password", autocomplete="current-password"
)

elif not st.session_state["password_correct"]:
# Password not correct, show input + error.
st.text_input(
"Password", type="password", on_change=password_entered, key="password", autocomplete="current-password"
)
st.error("😕 Password incorrect")
if not auth0_logged:
if "password_correct" not in st.session_state:
# First run, show input for password.
st.text_input(
"Password", type="password", on_change=password_entered, key="password", autocomplete="current-password"
)

else:
# Password correct, show success message.
st.success("🔒 Password correct")
password_logged = True
elif not st.session_state["password_correct"]:
# Password not correct, show input + error.
st.text_input(
"Password", type="password", on_change=password_entered, key="password", autocomplete="current-password"
)
st.error("😕 Password incorrect")

else:
# Password correct, show success message.
st.success("🔒 Password correct")
password_logged = True

if auth0_logged or password_logged:
return True
Expand Down

0 comments on commit 3c60b96

Please sign in to comment.