Skip to content

Commit

Permalink
Adding debugging logs
Browse files Browse the repository at this point in the history
  • Loading branch information
sumesh-aot committed Dec 19, 2024
1 parent 14b5001 commit 804ec29
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions redash/handlers/embed.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,21 @@ def embed(query_id, visualization_id, org_slug=None):
@login_required
@csp_allows_embeding
def public_dashboard(token, org_slug=None):
logger.info(f"Inside >>> public_dashboard : {token}")
logger.info(f"current_user.is_api_user() : {current_user.is_api_user()}")
if current_user.is_api_user():
dashboard = current_user.object

else:
api_key = get_object(models.ApiKey.get_by_api_key, token)
logger.info(f" api_key : {api_key}")
if api_key:
dashboard = api_key.object
logger.info('dashboard %s', dashboard)
else:
# Here if the object is not found using the api_key try to decode the token using salt and see if it's valid
decoded_token = decode_token(token)
logger.info(f" decoded_token : {decoded_token}")
if decode_token:
dashboard_id = decoded_token.get('id')
logger.info('Extracted dashboard id from the token : %s', dashboard_id)
Expand Down

0 comments on commit 804ec29

Please sign in to comment.