# Pre Signup action - Passwordless with Organizations

**URL:** <https://community.auth0.com/t/pre-signup-action-passwordless-with-organizations/103677>\
**Category:** Get Help\
**Tags:** other, missing-category\
**Created:** [March 29, 2023, 7:13pm UTC](https://community.auth0.com/t/pre-signup-action-passwordless-with-organizations/103677 "2023-03-29T19:13:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![adrian\_gd](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/adrian_gd/32/45114_2.png) [@adrian\_gd](https://community.auth0.com/u/adrian_gd)\
**Post date:** [March 29, 2023, 7:13pm UTC](https://community.auth0.com/t/pre-signup-action-passwordless-with-organizations/103677/1 "2023-03-29T19:13:49Z")

</div>

I am trying to setup Passworldless login with organizations and add a pre signup hook to validate the email domain against the organization to which the user is login. The problem is that there is no way of knowing the organization from inside the hook, even if it is send in authorizationParams. Any way to go around it?

Based on [Passing custom parameters to pre-registration action from New Universal Login](https://community.auth0.com/t/passing-custom-parameters-to-pre-registration-action-from-new-universal-login/71594). I can see that it is not possible to pass custom parameters but I should at least be able to see the organization

```js
const providerConfig = {
  domain: config.domain,
  clientId: config.clientId,
  onRedirectCallback,
  authorizationParams: {
    organization: "ORGANIZATION_ID",
    redirect_uri: window.location.origin,
    connection: "email",
    ...(config.audience ? { audience: config.audience } : null),
  },
};

ReactDOM.render(
  <Auth0Provider {...providerConfig}>
    <App />
  </Auth0Provider>,
  document.getElementById("root")
);

```

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [March 30, 2023, 8:42pm UTC](https://community.auth0.com/t/pre-signup-action-passwordless-with-organizations/103677/3 "2023-03-30T20:42:02Z")

</div>

Hi @adrian_gd,

Welcome to the Auth0 Community!

> [@adrian\_gd](#):
>
> I am trying to setup Passworldless login with organizations and add a pre signup hook to validate the email domain against the organization to which the user is login. The problem is that there is no way of knowing the organization from inside the hook, even if it is send in authorizationParams. Any way to go around it?

Your observations are correct! It is currently not possible to determine the Organization name in a Pre User Registration Action.

As an alternative, I recommend using a [Post-Login Action](https://auth0.com/docs/customize/actions/flows-and-triggers/login-flow) to check the user’s email domain against the Organization on their first login.

The code to do this would be something like the following:

```auto
exports.onExecutePostLogin = async (event, api) => {
  if (event.stats.logins_count === 1 && event.connection.strategy === "email"){ // First login and authenticating with Passwordless Email
    
    var userEmailDomain = event.user.email.split('@')[1].split('.')[0] // Get the user's email domain
    
    if(userEmailDomain === event.organization.name){
      // Your logic here
    }
  }
};

```

I hope this helps!

Please let me know if you have any questions or need further clarification.

Thanks,  
Rueben

---

<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:** [April 13, 2023, 8:42pm UTC](https://community.auth0.com/t/pre-signup-action-passwordless-with-organizations/103677/4 "2023-04-13T20:42:36Z")

</div>

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