# Sending extra params with loginWithRedirect (auth0-js-spa)

**URL:** <https://community.auth0.com/t/sending-extra-params-with-loginwithredirect-auth0-js-spa/81448>\
**Category:** Get Help\
**Tags:** signup\
**Created:** [April 8, 2022, 1:09pm UTC](https://community.auth0.com/t/sending-extra-params-with-loginwithredirect-auth0-js-spa/81448 "2022-04-08T13:09:40Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![chris.lock](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/chris.lock/32/12821_2.png) [@chris.lock](https://community.auth0.com/u/chris.lock)\
**Post date:** [April 8, 2022, 1:09pm UTC](https://community.auth0.com/t/sending-extra-params-with-loginwithredirect-auth0-js-spa/81448/1 "2022-04-08T13:09:40Z")

</div>

I’ve seen a few posts asking about being able to send parameters over the signup that can be used in Actions and/or Rules and a lot of them reference using custom domains but I am trying to get it to work without custom domains.

**Scenario:**  
We want to be able to distinguish between a “business” and an “individual” signup so our intention is to use the `loginWithRedirect` with an extra parameter to be able to distinguish between the two.

```auto
authClient.loginWithRedirect({
  screen_hint: 'signup',
  extraParam: 'foo'
});

```

We have a `pre-registration` action that is looking putting the entire event into the `app_metadata` in order that we can see the query

```auto
exports.onExecutePreUserRegistration = async (event, api) => {
  api.user.setAppMetadata('event', event);
};

```

Once the user has signed up we can see the entire `event` in the `app_metadata` but no sign of the `extraParam`. Any ideas what we might be doing wrong?

---

<div class="post-metadata">

**Author:** ![jack.macdonald](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jack.macdonald/32/12764_2.png) [@jack.macdonald](https://community.auth0.com/u/jack.macdonald)\
**Post date:** [April 8, 2022, 2:10pm UTC](https://community.auth0.com/t/sending-extra-params-with-loginwithredirect-auth0-js-spa/81448/2 "2022-04-08T14:10:32Z")

</div>

event.request.query (which is where those extra params will be) is not available in the pre-registration action. It is available in a post-login action if you can use that instead.

---

<div class="post-metadata">

**Author:** ![chris.lock](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/chris.lock/32/12821_2.png) [@chris.lock](https://community.auth0.com/u/chris.lock)\
**Post date:** [April 8, 2022, 3:52pm UTC](https://community.auth0.com/t/sending-extra-params-with-loginwithredirect-auth0-js-spa/81448/3 "2022-04-08T15:52:29Z")

</div>

Yep, we literally just figured this out… typical!

Although I will say that it did not occur to me that they would not be available in pre-registration or indeed post-registration which is why it was bugging me that it was not working. There might be something that can be improved in the documentation here or I may have looked past it.

Thanks for the response, really appreciate it.

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [April 28, 2022, 11:25am UTC](https://community.auth0.com/t/sending-extra-params-with-loginwithredirect-auth0-js-spa/81448/4 "2022-04-28T11:25:06Z")

</div>

Teamwork makes the dreamwork!

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [April 28, 2022, 11:25am UTC](https://community.auth0.com/t/sending-extra-params-with-loginwithredirect-auth0-js-spa/81448/5 "2022-04-28T11:25:09Z")

</div>


