How to pass connection and org_id to bypass org selection in nextjs

Hi @arahman,

Welcome to the Auth0 Community!

The /api/auth/login is not missing, but the routing is done automatically with the newest version of the NextJS SDK, so in the V4 version you do not have to manually configure a login route handler.

Our V4_MIGRATION_GUIDE specifies that:

In v4, you can simply append the authorization parameters to the query parameter of the login endpoint and they will be automatically fowarded to the /authorize endpoint, like so:

<a href="/auth/login?audience=urn:my-api">Login</a>

Or alternatively, it can be statically configured when initializing the SDK, like so:

export const auth0 = new Auth0Client({
  authorizationParameters: {
    scope: "openid profile email",
    audience: "urn:custom:api",
    ext-param: "value" // such as connection or organization 
  },
})

This information is also detailed on the EXAMPLES.md page of the SDK, particularly about the returnTo parameter as well.

This Knowledge Article should help as well - Pass Additional Parameter to the Universal Login URL.

I hope this helps.
Thanks,
Remus