"something went wrong" when existing user accepts an Organization invitation

Background:

We are using the Organization feature, so users must be a member of an organization to log in successfully. If members of multiple organizations, when they log on they are prompted to select the one they want to access.

The app is set to require credentials (email and password) on Login.

We are using the new Universal Login experience and the default database connection.

Scenario:

  1. OrgA sends invitation to User1
  2. User1 clicks on OrgA invitation link, is directed to Auth0 “Sign up to accept invitation” → user’s email is displayed, read-only, and password field is mandatory
  3. User1 inputs password and clicks Continue → User1 is signed in to the application and accessToken shows OrgA as expected. New User record is created in Auth0 for User1 with membership to OrgA
  4. User1 logs out
  5. OrgB sends invitation to User1
  6. User1 clicks on OrgB invitation link, is directed to “Sign up to accept invitation”
  7. User1 inputs password and clicks Continue

Result: “Something went wrong, please try again later”

I expect this is because there is already a User account for User1, and so the user should click on the “Log in” option under the form where it says “Already have an account?” However, if this is the case, then either:

  • The error should say “Account found, please log in instead”
  • When Auth0 loads up the form, could detect that the email already exists on a user record and load up the Login form first.

How can we prevent the user getting stuck at this point as it’s not clear from the error what to do?