# Login and Pre Register Redirect Action

**URL:** <https://community.auth0.com/t/login-and-pre-register-redirect-action/104938>\
**Category:** Get Help\
**Tags:** new-universal-login-experience, login-experience\
**Created:** [April 18, 2023, 2:19am UTC](https://community.auth0.com/t/login-and-pre-register-redirect-action/104938 "2023-04-18T02:19:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tolgahanbora](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/tolgahanbora/32/46412_2.png) [@tolgahanbora](https://community.auth0.com/u/tolgahanbora)\
**Post date:** [April 18, 2023, 2:19am UTC](https://community.auth0.com/t/login-and-pre-register-redirect-action/104938/1 "2023-04-18T02:19:41Z")

</div>

Hi guys,

I found that issues but i didn’t fix that.

I can redirect any website, [google.com](http://google.com) or [auth0.com](http://auth0.com) bla bla… but i can not redirect my website, localhot. Cuz sign in or login button first redirect universal login&register page and this page redirect my website. I wish everybody understood… so how can i fix that ?

```auto
exports.onExecutePostLogin = async (event, api) => {

    api.redirect.sendUserTo('http://localhost:3000/MyProfile'
); //didn't redirect
  }

```

```auto
exports.onExecutePostLogin = async (event, api) => {

    api.redirect.sendUserTo('https://google.com'
); //redirect success
  }

```

---

<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:** [April 26, 2023, 2:25pm UTC](https://community.auth0.com/t/login-and-pre-register-redirect-action/104938/3 "2023-04-26T14:25:58Z")

</div>

Hi @tolgahanbora,

Welcome to the Auth0 Community!

Based on your information, you would like to redirect users to your website in the POST Login action. Auth0 Actions are serverless functions that run on the Auth0 side, so redirecting the user to localhost:3000 won’t redirect to your local application. To achieve the expected flow, you must host your application and make it accessible from places other than your local machine. You can learn more about redirecting in actions from [here](https://auth0.com/docs/customize/actions/flows-and-triggers/login-flow/redirect-with-actions).

---

<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:** [May 10, 2023, 2:26pm UTC](https://community.auth0.com/t/login-and-pre-register-redirect-action/104938/4 "2023-05-10T14:26:35Z")

</div>

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