Skip to content

Commit

Permalink
remove password
Browse files Browse the repository at this point in the history
  • Loading branch information
peterdudfield committed Dec 2, 2024
1 parent e2f759a commit 8cac2c2
Showing 1 changed file with 1 addition and 22 deletions.
23 changes: 1 addition & 22 deletions src/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ def check_password():
)

auth0_logged = False
password_logged = False

# check if we have logged on with a password, if we havent show auth0
if ("password_correct" not in st.session_state) or (not st.session_state["password_correct"]):
Expand All @@ -61,27 +60,7 @@ def check_password():
else:
auth0_logged = True

# if we have not logged in with auth0
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"
)

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:
if auth0_logged:
return True
else:
st.text('Please log in')
Expand Down

0 comments on commit 8cac2c2

Please sign in to comment.