Redirect to the last url?

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
but how would I read it back at rails? at callback?

I found this doc: 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.

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.