Skip to content

Commit

Permalink
Merge pull request #250 from MAYANK12SHARMA/main
Browse files Browse the repository at this point in the history
fix: Timed Dialog Box for Success Message After Correct Password Entry
  • Loading branch information
peterdudfield authored Jan 10, 2025
2 parents 86f5b2b + fb2f7a0 commit 2fcf850
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 5 deletions.
22 changes: 19 additions & 3 deletions src/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import ssl
from auth0_component import login_button
import logging
import time

clientId = os.getenv("AUTH0_CLIENT_ID")
domain = os.getenv("AUTH0_DOMAIN")
Expand Down Expand Up @@ -74,11 +75,26 @@ def check_password():
st.text_input(
"Password", type="password", on_change=password_entered, key="password", autocomplete="current-password"
)
st.error("😕 Password incorrect")
# Create a dialog box container
dialog_box = st.empty()

# Show success message in dialog box
dialog_box.error("🔒 Password incorrect")

# Wait for 3 seconds (adjust time as needed) before removing it
time.sleep(3)

# Clear the dialog box after delay
dialog_box.empty()

else:
# Password correct, show success message.
st.success("🔒 Password correct")
# Create a dialog box container
dialog_box = st.empty()

dialog_box.success("🔒 Password correct")

# Clear the dialog box after delay
dialog_box.empty()
password_logged = True

if auth0_logged or password_logged:
Expand Down
Empty file added src/site_toolbox/__init__.py
Empty file.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions src/sites_toolbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
create_site_group
)

from sites_toolbox.get_details import (
from site_toolbox.get_details import (
get_user_details,
get_site_details,
get_site_group_details,
)

from sites_toolbox.site_group_management import (
from site_toolbox.site_group_management import (
select_site_id,
update_site_group,
change_user_site_group,
Expand Down

0 comments on commit 2fcf850

Please sign in to comment.