# Forgot password when user is invited to another organization

**URL:** <https://community.auth0.com/t/forgot-password-when-user-is-invited-to-another-organization/118408>\
**Category:** Get Help\
**Tags:** reset-password-prompt-new-experience, login-experience\
**Created:** [October 12, 2023, 2:44pm UTC](https://community.auth0.com/t/forgot-password-when-user-is-invited-to-another-organization/118408 "2023-10-12T14:44:03Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![robMindfuel](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/robmindfuel/32/71444_2.png) [@robMindfuel](https://community.auth0.com/u/robMindfuel)\
**Post date:** [October 12, 2023, 2:44pm UTC](https://community.auth0.com/t/forgot-password-when-user-is-invited-to-another-organization/118408/1 "2023-10-12T14:44:03Z")

</div>

Hi!

I have just noticed that when we invite already registered user to another organization and when the user tries to use “Forgot password” functionality it simply doesn’t work. Meaning the email is not sent and there is an error in logs:  
`User does not exist or user is not part of organization`

Which is kind of clear, because there is an orgId in URL. Do you have any solution how to mitigate that?

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [October 17, 2023, 8:58pm UTC](https://community.auth0.com/t/forgot-password-when-user-is-invited-to-another-organization/118408/3 "2023-10-17T20:58:56Z")

</div>

Hi @robMindfuel

> [@robMindfuel](#):
>
> Which is kind of clear, because there is an orgId in URL. Do you have any solution how to mitigate that?

I’m having trouble understanding what you are asking here. Do you have some more information, maybe an example, that could help illustrate the problem you are facing?

---

<div class="post-metadata">

**Author:** ![robMindfuel](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/robmindfuel/32/71444_2.png) [@robMindfuel](https://community.auth0.com/u/robMindfuel)\
**Post date:** [November 3, 2023, 12:51pm UTC](https://community.auth0.com/t/forgot-password-when-user-is-invited-to-another-organization/118408/4 "2023-11-03T12:51:12Z")

</div>

@dan.woda Sure. Let me briefly explain the situation step by step:

1. Let’s have a USER that belongs to Organization A
2. The USER is being invited to Organization B
3. USER receives the invitation
4. USER tries to reset the password using an invitation link to Organization B

It ends up with an error in logs: `User does not exist or user is not part of organization`

---

<div class="post-metadata">

**Author:** ![jrosen-cc](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jrosen-cc/32/52434_2.png) [@jrosen-cc](https://community.auth0.com/u/jrosen-cc)\
**Post date:** [December 6, 2023, 6:22pm UTC](https://community.auth0.com/t/forgot-password-when-user-is-invited-to-another-organization/118408/5 "2023-12-06T18:22:52Z")

</div>

I was experiencing something similar. It turned out that Auth0 was sending me an `invitation` and `organization` in URL search params and I wasn’t passing them back.

The app in question was using auth0-react, so the relevant code is

```auto
const Auth0Wrapper = ({ children }) => {
  const options = {
    domain: 'my.domain',
    clientId: 'my.client.id',
    audience: 'my-audience',
  }

  // Copy invitation and organization from URL to send back:
  const params = new URL(document.location.href).searchParams
  if (params.has('invitation')) { options.invitation = params.get('invitation') }
  if (params.has('organization')) { options.invitation = params.get('organization') }

  return (
    <Auth0Provider {...options}>{children}</Auth0Provider>
  )
}

```

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [December 7, 2023, 2:22pm UTC](https://community.auth0.com/t/forgot-password-when-user-is-invited-to-another-organization/118408/6 "2023-12-07T14:22:55Z")

</div>

Thanks for the help @jrosen-cc!

---

<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:** [December 22, 2023, 5:58pm UTC](https://community.auth0.com/t/forgot-password-when-user-is-invited-to-another-organization/118408/7 "2023-12-22T17:58:17Z")

</div>

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