Skip to content

user invites: Log sign up views with invitedBy param even if the user is logged in or sign up is disabled

Warren Gifford requested to merge ps/log-invited-by-visits-in-any-case into main

Created by: philipp-spiess

Part of #31214 (closed)

After a discussion with @slimsag I’m making a change to when we log incoming page views with the invitedBy link set. These events are used to know when invited users click on the invitation link.

Right now, these events are only logged when users have no account yet and render the sign up form. However, especially if we want to include server users, we'll need to be more liberal in what we accept since e.g. in some on-prem setups, SSO is configured so that users will always be logged in once they visit this link.

To do this, we move the logging to before we do any potential redirects and I've also added two params to the event that we can later use to distinguish between the new scenarios and the existing case:

  • isAuthenticated: When this is true, the user is authenticated and will be redirected to the product instead.
  • allowSignup: When this is false, sign-up is disabled and the user will be redirected to the login screen instead.

Test plan

I verified that there's no regression in the case of cloud sign-up when logged out and verified that this works with redirects for cloud when signed in:

Signed out

Screenshot 2022-03-10 at 14 29 37

Signed in

Screenshot 2022-03-10 at 14 30 16

Merge request reports

Loading