Skip to content

Commit

Permalink
chore: add some logging to help when folk say it doesn't work
Browse files Browse the repository at this point in the history
  • Loading branch information
pauldambra committed Oct 24, 2024
1 parent 632bb8d commit e7895c2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions posthog/api/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,9 @@ def redirect_to_site(request):
return HttpResponse(status=404)

if not team or not unparsed_hostname_in_allowed_url_list(team.app_urls, app_url):
logger.info(
"can_only_redirect_to_permitted_domain", permitted_domains=team.app_urls, app_url=app_url, team_id=team.id
)
return HttpResponse(f"Can only redirect to a permitted domain.", status=403)
request.user.temporary_token = secrets.token_urlsafe(32)
request.user.save()
Expand Down Expand Up @@ -532,6 +535,9 @@ def redirect_to_website(request):
return HttpResponse(status=404)

if not team or urllib.parse.urlparse(app_url).hostname not in PERMITTED_FORUM_DOMAINS:
logger.info(
"can_only_redirect_to_permitted_domain", permitted_domains=team.app_urls, app_url=app_url, team_id=team.id
)
return HttpResponse(f"Can only redirect to a permitted domain.", status=403)

token = ""
Expand Down

0 comments on commit e7895c2

Please sign in to comment.