# How do i redirect on onExecutePostUserRegistration

**URL:** <https://community.auth0.com/t/how-do-i-redirect-on-onexecutepostuserregistration/98400>\
**Category:** Get Help\
**Tags:** signup-prompt-new-experience, login-experience\
**Created:** [January 18, 2023, 8:55am UTC](https://community.auth0.com/t/how-do-i-redirect-on-onexecutepostuserregistration/98400 "2023-01-18T08:55:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bernardcooley](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/bernardcooley/32/42763_2.png) [@bernardcooley](https://community.auth0.com/u/bernardcooley)\
**Post date:** [January 18, 2023, 8:55am UTC](https://community.auth0.com/t/how-do-i-redirect-on-onexecutepostuserregistration/98400/1 "2023-01-18T08:55:09Z")

</div>

Im looking to redirect the user to different pages depending on whether theyve signed in or signed up. api.redirect doesnt seem to be available on onExecutePostUserRegistration. How can i trigger a custom redirect?

---

<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:** [January 18, 2023, 10:37pm UTC](https://community.auth0.com/t/how-do-i-redirect-on-onexecutepostuserregistration/98400/3 "2023-01-18T22:37:23Z")

</div>

Hi @bernardcooley,

Welcome to the Auth0 Community!

Unfortunately, the Post User Registration Action does not allow for a redirect as you discovered. The only way to use a redirect action is in a Post Login Action script.

One workaround I can offer is to use a Post Login Action to redirect your users based on their login count. Let me emphasize that whenever a sign-up is complete, it automatically logs the user in. Given that, we can redirect sign-up users by checking if their logins\_count value equals 1.

For example:

```auto
exports.onExecutePostLogin = async (event, api) => {
  if(event.stats.logins_count > 1){
    //log in users
    api.redirect.sendUserTo("FIRST_URL");
  } else {
    //sign up users
    api.redirect.sendUserTo("SECOND_URL" };
};

exports.onContinuePostLogin = async (event, api) => {
}

```

Reference Materials:

- [Redirect with Actions](https://auth0.com/docs/customize/actions/flows-and-triggers/login-flow/redirect-with-actions#resume-the-authentication-flow)

Please let me know if you have any additional questions.

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:** [February 1, 2023, 10:38pm UTC](https://community.auth0.com/t/how-do-i-redirect-on-onexecutepostuserregistration/98400/4 "2023-02-01T22:38:09Z")

</div>

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