Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add some logging to help when folk say it doesn't work #25794

Merged
merged 1 commit into from
Oct 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading