PostHog / posthog

🦔 PostHog provides open-source web & product analytics, session recording, feature flagging and A/B testing that you can self-host. Get started - free.
https://posthog.com
Other
21.92k stars 1.31k forks source link

Invite `ValidationError` isn't bubbled up properly in social auth #12854

Open sentry-io[bot] opened 1 year ago

sentry-io[bot] commented 1 year ago

Sentry Issue: POSTHOG-5WD

ValidationError: [ErrorDetail(string='This invite is intended for another email address: x. You tried to sign up with X.', code='invalid_recipient')]
(17 additional frame(s) were not displayed)
...
  File "social_core/backends/base.py", line 113, in run_pipeline
    result = func(*args, **out) or {}
  File "social_core/pipeline/partial.py", line 30, in wrapper
    out = func(strategy=strategy,
  File "posthog/api/signup.py", line 420, in social_create_user
    user = process_social_invite_signup(strategy, invite_id, email, full_name)
  File "posthog/api/signup.py", line 336, in process_social_invite_signup
    invite.validate(user=None, email=email)
  File "posthog/models/organization.py", line 315, in validate
    raise exceptions.ValidationError(
Aeolun commented 1 week ago

I just noticed this again xD I guess it doesn't matter for many people, but my invite email is different than the social account I'm signing up with, and the UI doesn't show any error at all.