# How to pass connection and org\_id to bypass org selection in nextjs

**URL:** <https://community.auth0.com/t/how-to-pass-connection-and-org-id-to-bypass-org-selection-in-nextjs/189849>\
**Category:** Get Help\
**Tags:** configuration, application\
**Created:** [July 29, 2025, 5:01pm UTC](https://community.auth0.com/t/how-to-pass-connection-and-org-id-to-bypass-org-selection-in-nextjs/189849 "2025-07-29T17:01:31Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![arahman](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/arahman/32/73230_2.png) [@arahman](https://community.auth0.com/u/arahman)\
**Post date:** [July 29, 2025, 5:01pm UTC](https://community.auth0.com/t/how-to-pass-connection-and-org-id-to-bypass-org-selection-in-nextjs/189849/1 "2025-07-29T17:01:31Z")

</div>

As of 07/2025 it seems that there was a huge revision to the auth0 nextjs SDK. I cant find where in the examples it displays how to pass `connection` and `organization` parameters to bypass the selection screen.

How would you do this in the new paradigm with the new auth handler?

Here is the old way to do it using the login handler:

```auto
		const loginOptions = {
			authorizationParams: {
				prompt: 'login',
				// Conditionally add organization and connection parameters
				// These will only be added if an organizationId was successfully found it has a connection value.
				...(organizationId ? { organization: organizationId } : {}),
				...(organizationId && connectionValue
					? { connection: connectionValue }
					: {}),
			},
			returnTo: '/api/auth/postlogin', // Your existing returnTo path
		};

		return handleLogin(request, res, loginOptions);

```

Its not clear to me how to do this with the handler endpoint missing? Would i move this logic to middleware? We rely on query params.

---

<div class="post-metadata">

**Author:** ![remus.ivan](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/remus.ivan/32/68771_2.png) [@remus.ivan](https://community.auth0.com/u/remus.ivan)\
**Post date:** [July 29, 2025, 7:12pm UTC](https://community.auth0.com/t/how-to-pass-connection-and-org-id-to-bypass-org-selection-in-nextjs/189849/3 "2025-07-29T19:12:19Z")

</div>

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](https://github.com/auth0/nextjs-auth0/blob/main/V4_MIGRATION_GUIDE.md) 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:

```auto
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](https://github.com/auth0/nextjs-auth0/blob/main/EXAMPLES.md#passing-authorization-parameters) 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](https://community.auth0.com/t/pass-additional-parameter-to-the-universal-login-url/140112).

I hope this helps.  
Thanks,  
Remus

---

<div class="post-metadata">

**Author:** ![arahman](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/arahman/32/73230_2.png) [@arahman](https://community.auth0.com/u/arahman)\
**Post date:** [July 29, 2025, 7:23pm UTC](https://community.auth0.com/t/how-to-pass-connection-and-org-id-to-bypass-org-selection-in-nextjs/189849/4 "2025-07-29T19:23:33Z")

</div>

Hi Remus,

Thank you for responding!

So if i wanted to pass on `organization` and `connection` parameters i could do so like this?  
`<a href="/auth/login?organization=auth0orgId&connection=auth0connectionId">Login</a>`

This is to bypass this screen for my users:

 ![Screenshot 2025-07-29 at 3.23.12 PM](https://global.discourse-cdn.com/auth0/original/3X/8/9/89c9f27b72ce124cd6d9e9c770d5cb14762caa18.png)

Thanks!

---

<div class="post-metadata">

**Author:** ![remus.ivan](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/remus.ivan/32/68771_2.png) [@remus.ivan](https://community.auth0.com/u/remus.ivan)\
**Post date:** [July 30, 2025, 3:43pm UTC](https://community.auth0.com/t/how-to-pass-connection-and-org-id-to-bypass-org-selection-in-nextjs/189849/5 "2025-07-30T15:43:15Z")

</div>

Hi @arahman,

The added query parameters to the URL mentioned above look correct to me, so indeed by passing the organization to the `/authorize` your users should be prompted to enter their organization first.

If you have other questions please let me know.  
Thanks,  
Remus

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [August 13, 2025, 3:44pm UTC](https://community.auth0.com/t/how-to-pass-connection-and-org-id-to-bypass-org-selection-in-nextjs/189849/6 "2025-08-13T15:44:12Z")

</div>

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