# Unable to persist query param (ref) in Post User Registration Action

**URL:** <https://community.auth0.com/t/unable-to-persist-query-param-ref-in-post-user-registration-action/187925>\
**Category:** Get Help\
**Tags:** user-profile, user-management\
**Created:** [June 13, 2025, 8:20am UTC](https://community.auth0.com/t/unable-to-persist-query-param-ref-in-post-user-registration-action/187925 "2025-06-13T08:20:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![a.bilani](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/a.bilani/32/74784_2.png) [@a.bilani](https://community.auth0.com/u/a.bilani)\
**Post date:** [June 13, 2025, 8:20am UTC](https://community.auth0.com/t/unable-to-persist-query-param-ref-in-post-user-registration-action/187925/1 "2025-06-13T08:20:48Z")

</div>

I’m trying to pass a `ref` query parameter during `signup` using `loginWithRedirect({ authorizationParams: { screen_hint: "signup", ref: "xyz" } })`, and I want to access that flag in the `onExecutePostUserRegistration` action.

I tried this code:

js

CopyEdit

```auto
exports.onExecutePostUserRegistration = async (event, api) => {
  const ref = event.request.query?.ref;
  if (ref) {
    api.user.setUserMetadata("ref", ref);
  }
};

```

But it looks like `event.request.query` is undefined or doesn’t include the query string. I suspect the `ref` param doesn’t survive the email verification link.

**What’s the recommended way to pass a referral flag or other custom data through the signup process and access it in the Post User Registration Action?**

I want to avoid a database or session store unless necessary.

---

<div class="post-metadata">

**Author:** ![dawid.matuszczyk](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dawid.matuszczyk/32/74550_2.png) [@dawid.matuszczyk](https://community.auth0.com/u/dawid.matuszczyk)\
**Post date:** [June 30, 2025, 4:56pm UTC](https://community.auth0.com/t/unable-to-persist-query-param-ref-in-post-user-registration-action/187925/3 "2025-06-30T16:56:56Z")

</div>

Hi @a.bilani

Welcome to the Auth0 Community!

Thank you for posting your question. Unfortunately, the event request.query property is not available in the pre-user registration Action. It’s available in the post-Login Action only. You can read more about that here → [Pre-registration Action with event.request.query](https://community.auth0.com/t/pre-registration-action-with-event-request-query/114549?utm_source=chatgpt.com)

I would encourage you to create a new topic in the #Product Feedback category, explaining your use case and desired solution. Make sure to vote on your card!

Thanks  
Dawid

---

<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:** [July 14, 2025, 4:57pm UTC](https://community.auth0.com/t/unable-to-persist-query-param-ref-in-post-user-registration-action/187925/4 "2025-07-14T16:57:18Z")

</div>

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