Auth0 Organizations login error

I am trying to handle the following situation:

  • I have 2 organizations: A and B.
  • I have a user, M, that is a member of A but not B.
  • M tries to login using their credentials for A but for B’s organization login page.

What is the proper way to handle this?

I would like to display a “wrong email and password” message on the login page as this user did not enter valid credentials for this organization, but this does not seem possible to do as the request continues through and the /callback endpoint in my application is then called by auth0, as if it were a successful login, except there is a payload that tells me this user does not belong to that organization. There does not seem to be a good way to redirect back to the universal login page for the organization and display an error message to this user now.

Any ideas?

2 Likes

Furthermore, I would like to in some way customize the text that is displayed on the login page. It appears to be pulling the org name and the application name to display a message to the user similar to "Log in to <Organization> to continue to <Application>."

I want to be able to write a custom message there as opposed to this automatically generated one.

I think this is related to the main thread as it relates to customizing certain parts of the universal login experience.

For more information, I am using the @auth0/nextjs-auth0 SDK.

I am also having the same issues.

@headwall-labs were you able to figure out a way to fix it?