Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
rodja committed Sep 24, 2023
1 parent ee9ae7d commit 73c906f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion examples/descope_auth/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def login():

@user.page('/')
def home():
ui.markdown(f'```\n{json.dumps(user.about(),indent=2)}\n```')
ui.markdown(f'```\n{json.dumps(user.about(), indent=2)}\n```')
ui.button('Logout', on_click=user.logout)


Expand Down
8 changes: 3 additions & 5 deletions examples/descope_auth/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,9 @@ def login_form() -> ui.element:

def about() -> Dict[str, Any]:
"""Returns the user's Descope profile."""
try:
return app.storage.user['descope']
except AuthException:
logging.exception("Unable to load user.")
return {}
infos = app.storage.user['descope']
if not infos:
raise Exception('User is not logged in.')


async def logout() -> None:
Expand Down

0 comments on commit 73c906f

Please sign in to comment.