# How do I get the state after redirect from rule, in a react app?

**URL:** <https://community.auth0.com/t/how-do-i-get-the-state-after-redirect-from-rule-in-a-react-app/60784>\
**Category:** Get Help\
**Tags:** react\
**Created:** [April 8, 2021, 5:54pm UTC](https://community.auth0.com/t/how-do-i-get-the-state-after-redirect-from-rule-in-a-react-app/60784 "2021-04-08T17:54:28Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![reuven.josef.k](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/reuven.josef.k/32/28675_2.png) [@reuven.josef.k](https://community.auth0.com/u/reuven.josef.k)\
**Post date:** [April 8, 2021, 5:54pm UTC](https://community.auth0.com/t/how-do-i-get-the-state-after-redirect-from-rule-in-a-react-app/60784/1 "2021-04-08T17:54:28Z")

</div>

I need to get the state after redirect in order to send it back with the continue redirect, when and how do I get the state in the client side?  
From what I’ve seen, people are avoiding redirect in react.

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [April 8, 2021, 9:19pm UTC](https://community.auth0.com/t/how-do-i-get-the-state-after-redirect-from-rule-in-a-react-app/60784/3 "2021-04-08T21:19:31Z")

</div>

Hi @reuven.josef.k,

Welcome to the Community!

It sounds like you are referring to a redirect rule. Assuming that is the redirect you are talking about, it should be available as a param in the URL. Like this:

`https://example.com/foo?state=abc123`

---

<div class="post-metadata">

**Author:** ![reuven.josef.k](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/reuven.josef.k/32/28675_2.png) [@reuven.josef.k](https://community.auth0.com/u/reuven.josef.k)\
**Post date:** [April 11, 2021, 9:36am UTC](https://community.auth0.com/t/how-do-i-get-the-state-after-redirect-from-rule-in-a-react-app/60784/4 "2021-04-11T09:36:18Z")

</div>

Thank you for the answer.  
I’ve got another question,  
I tried redirecting to the continue route with the state parameter, using the react-router-dom redirect component, The redirect is happening with the state, but the user is not authenticated.  
I also tried adding a get request to an express server, but I can’t accept the redirect because of cros.  
It’s not clear how this works, how dose Auth0 know if I made a redirect to the continue route?

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [April 12, 2021, 4:13pm UTC](https://community.auth0.com/t/how-do-i-get-the-state-after-redirect-from-rule-in-a-react-app/60784/5 "2021-04-12T16:13:31Z")

</div>

> [@reuven.josef.k](#):
>
> I tried redirecting to the continue route with the state parameter, using the react-router-dom redirect component, The redirect is happening with the state, but the user is not authenticated.

Can you expand on what is happening here? The tokens are never returned to your application? Or rules are not resuming because your request to `/continue` is not being accepted?

> [@reuven.josef.k](#):
>
> It’s not clear how this works, how dose Auth0 know if I made a redirect to the continue route?

I’m not sure I understand this question. Auth0 will receive the `/continue` request and continue running through the authentication pipeline.

---

<div class="post-metadata">

**Author:** ![reuven.josef.k](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/reuven.josef.k/32/28675_2.png) [@reuven.josef.k](https://community.auth0.com/u/reuven.josef.k)\
**Post date:** [April 12, 2021, 6:10pm UTC](https://community.auth0.com/t/how-do-i-get-the-state-after-redirect-from-rule-in-a-react-app/60784/6 "2021-04-12T18:10:35Z")

</div>

In the documentation the continue request looks like this:

> https://YOUR\_DOMAIN/continue?state=THE\_ORIGINAL\_STATE

It wasn’t cleat to me if you mean my Auth0 domein or my own domain, however how is it safe to make a request to another domain, It’s blocked by Cross-Origin policy?

I’ve moved on from this, I found a different solution without redirecting.

Thank you for your help.

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [April 13, 2021, 4:00pm UTC](https://community.auth0.com/t/how-do-i-get-the-state-after-redirect-from-rule-in-a-react-app/60784/7 "2021-04-13T16:00:09Z")

</div>

Thanks for providing an update.

I’ll answer your question for future users who see this.

The /continue endpoint expects the Auth0 domain you have been given or configured.

---

<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 28, 2021, 4:00pm UTC](https://community.auth0.com/t/how-do-i-get-the-state-after-redirect-from-rule-in-a-react-app/60784/8 "2021-04-28T16:00:47Z")

</div>

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