Next.js | Blank screen after Google social login with non-organization user

Hi!
I am using Next.js and @auth0/nextjs-auth0 npm package.
When user which is not included to organization logins via Google, callback redirect happens with an error details but the screen is blank.
{domain}/api/auth/callback?error=invalid_request&error_description=client%20requires%20organization%20membership%2C%20but%20user%20does%20not%20belong%20to%20any%20organization&state=eyJyZXR1cm5UbyI6Imh0dHBzOi8vbWVyY2hhbnRzLnNpa2FoZWFsdGguY29tLyJ9

Hi @eng1,

The error you are experiencing is expected when the user is not a part of the organization, and the Google Social Connection enabled for the organization does not assign members to the Organization on login.

In this scenario, you can either permit the user to log in to your app without being associated with an organization (if that is your intention), or you can Grant Just-In-Time Membership to an Organization Connection.

Thanks,
Rueben

@rueben.tiow getting the error is fine, the thing is that Default Error screen is not displayed - is it something we should configure on our end for Next.js? If this is happened, I am not able to log in again after page reload until I clear current session with wrong user.

Hi @eng1,

Thanks for the reply.

Have you tried monitoring the network activity when the Default Error page is not displayed? There might be some clues there.

If you need to forcibly end the session, you can call the /v2/logout endpoint in the browser. For example: https://yourDomain.us.auth0.com/v2/logout

Another option to consider is redirecting your users to your custom error page instead of displaying the default error page. Refer to the Custom Error Pages documentation to learn more.

Cheers,
Rueben

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.