user invites: Log sign up views with invitedBy param even if the user is logged in or sign up is disabled
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: