# Redirect to the last url?

**URL:** <https://community.auth0.com/t/redirect-to-the-last-url/6293>\
**Category:** Get Help\
**Tags:** redirect-rules\
**Created:** [April 20, 2017, 11:26am UTC](https://community.auth0.com/t/redirect-to-the-last-url/6293 "2017-04-20T11:26:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![as3now](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/as3now/32/7110_2.png) [@as3now](https://community.auth0.com/u/as3now)\
**Post date:** [April 20, 2017, 11:26am UTC](https://community.auth0.com/t/redirect-to-the-last-url/6293/1 "2017-04-20T11:26:39Z")

</div>

As in Auth0 docs, I can send a state value with the block dialog as here:

[https://auth0.com/docs/libraries/lock/v10/sending-authentication-parameters](https://auth0.com/docs/libraries/lock/v10/sending-authentication-parameters)  
but how would I read it back at rails? at callback?

I found this doc: [https://auth0.com/docs/protocols/oauth2/oauth-state](https://auth0.com/docs/protocols/oauth2/oauth-state) but, its not clear how to read back the state parameter I’ve sent in the callback handler of rails.

---

<div class="post-metadata">

**Author:** ![prashantT](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/prashantt/32/6002_2.png) [@prashantT](https://community.auth0.com/u/prashantT)\
**Post date:** [April 21, 2017, 12:24pm UTC](https://community.auth0.com/t/redirect-to-the-last-url/6293/2 "2017-04-21T12:24:12Z")

</div>

The state parameter will be passed back to your callback as a query string, or in the body, depending on the connection you use. You will need to parse this state parameter in your callback, and make the necessary checks.

---

<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:** [March 2, 2018, 5:53am UTC](https://community.auth0.com/t/redirect-to-the-last-url/6293/3 "2018-03-02T05:53:23Z")

</div>


