# How do I switch organizations when using @auth0/auth0-vue

**URL:** <https://community.auth0.com/t/how-do-i-switch-organizations-when-using-auth0-auth0-vue/85107>\
**Category:** Get Help\
**Tags:** organizations\
**Created:** [June 14, 2022, 4:52pm UTC](https://community.auth0.com/t/how-do-i-switch-organizations-when-using-auth0-auth0-vue/85107 "2022-06-14T16:52:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jgleason](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jgleason/32/25904_2.png) [@jgleason](https://community.auth0.com/u/jgleason)\
**Post date:** [June 14, 2022, 4:52pm UTC](https://community.auth0.com/t/how-do-i-switch-organizations-when-using-auth0-auth0-vue/85107/1 "2022-06-14T16:52:37Z")

</div>

I am using the Vue PKCE library to handle auth. A user can be in 1 to many orgs but I have to declare the org when I setup the Vue App…

```auto
const app = createApp(App);
// TODO: Get Vite to inject the domain and client values
app.use(
    createAuth0({
      domain: ...,
      client_id: ...,
      redirect_uri: window.location.origin,
      prompt: "consent",
      useRefreshTokens: true,
      organization: ...,
    }),
);

```

This works but I can’t figure a way to change the org or use multiple orgs. Is this possible given the construct?

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [June 21, 2022, 11:41pm UTC](https://community.auth0.com/t/how-do-i-switch-organizations-when-using-auth0-auth0-vue/85107/4 "2022-06-21T23:41:14Z")

</div>

Hi @jgleason!

> [@jgleason](#):
>
> This works but I can’t figure a way to change the org or use multiple orgs. Is this possible given the construct?

While you won’t be able to use multiple orgs at once, you could look into “switching” orgs by doing silent auth and including the `organization` param. You need to make another `/authorize` request with the new `org_id` in order to [specify the “new” org](https://community.auth0.com/t/authenticating-users-through-a-specific-organization/84679). While I haven’t attempted this using the vue SDK myself, the following topic may be useful:

> [@User switch between Organization](https://community.auth0.com/t/user-switch-between-organization/62609):
>
> Auth0 Organization fits perfect for my use case. However, after going through the docs on Organization, and looked at the implementation here [[Authentication services for SaaS companies](https://auth0.com/blog/introducing-auth0-organizations/)] . I have a couple questions. The claims (i.e. role and permission) are specific to the organization that the user auth against, so does that mean when a user switches between organizations, that user needs to sign out and sign back in or auth0 does some silent auth in the background to re-generate the access\_…

Let us know if you’re able to make any progress!

---

<div class="post-metadata">

**Author:** ![jgleason](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jgleason/32/25904_2.png) [@jgleason](https://community.auth0.com/u/jgleason)\
**Post date:** [June 22, 2022, 12:32pm UTC](https://community.auth0.com/t/how-do-i-switch-organizations-when-using-auth0-auth0-vue/85107/5 "2022-06-22T12:32:29Z")

</div>

RT but this doesn’t seem to be easily done with auth0-spa-js and Vue, since it is attached to the Vue instance I think I would have to setup a whole new Vue instance.

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [July 7, 2022, 12:32pm UTC](https://community.auth0.com/t/how-do-i-switch-organizations-when-using-auth0-auth0-vue/85107/6 "2022-07-07T12:32:30Z")

</div>

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