Invite flow error => User already exists { one connection, one application, multiple organisations }

We are using auth0 multi-tenant approach i.e. having multiple organizations where each act as a single tenant, to allow a user to use the same credentials(same email with username-password-connection) to log in to different organizations: Multiple Organization Architecture

Error: Invitation flow breaks when we send an invitation to a user that already exists(user exists in org-1, an invitation sent from org-2). Auth0 says “User already exists” on the signup page. Auth0 should take the user directly to the login screen instead of signup by referring to the details against the invitation code and connection id. Or we should(being consumers) be able to send a flag to the /authorize flow to open the login screen instead of the signup screen. The steps to reproduce this are explained below.

Flow

  1. Send an invitation to test-email@email.com, from ORG-1

  2. test-email@email.com clicks on the invitation link to signup

  3. From our app we call auth0 /authorize endpoint with the invitation code and org information attached, this completes the flow(i.e. user got registered).

  4. Send another invitation to test-email@email.com from ORG-2 this time

  5. test-email@email.com clicks on the invitation link to signup

  6. From our app we call auth0 /authorize endpoint with the invitation code and org information attached. When the user tries to register him/herself the auth0 flow throws an error “User already exists”.

Expected:

  1. Auth0 should match the email against the selected database connection, if email exists open the “log in section” instead of the “signup section”

  2. or the consumer of the /authorize API must be allowed to pass the parameter to default section to “log in”