From cb4513a488ae95129bcc6eff0b6573dea7ed0c44 Mon Sep 17 00:00:00 2001 From: peterdudfield Date: Mon, 23 Oct 2023 13:48:54 +0100 Subject: [PATCH] add logging --- src/auth.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/auth.py b/src/auth.py index 4cc53ae..e441baf 100644 --- a/src/auth.py +++ b/src/auth.py @@ -2,6 +2,7 @@ import streamlit as st import ssl from auth0_component import login_button +import logging clientId = os.getenv("AUTH0_CLIENT_ID") domain = os.getenv("AUTH0_DOMAIN") @@ -10,14 +11,17 @@ ssl._create_default_https_context = ssl._create_unverified_context +logger = logging.getLogger(__name__) + def check_password(): """Returns `True` if the user had the correct password.""" with st.sidebar: try: user_info = login_button(clientId=clientId, domain=domain,debug_logs=True) - except: + except Exception as e: st.text('Could not run auth') + logger.error(f'Could not run auth {e}') return False if user_info is None: