# State not included in redirect token (error: "State in the token does not match the /continue state")

**URL:** <https://community.auth0.com/t/state-not-included-in-redirect-token-error-state-in-the-token-does-not-match-the-continue-state/112729>\
**Category:** Get Help\
**Tags:** mfa-api, mfa\
**Created:** [August 2, 2023, 7:32pm UTC](https://community.auth0.com/t/state-not-included-in-redirect-token-error-state-in-the-token-does-not-match-the-continue-state/112729 "2023-08-02T19:32:59Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![daniel23](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/daniel23/32/49552_2.png) [@daniel23](https://community.auth0.com/u/daniel23)\
**Post date:** [August 2, 2023, 7:53pm UTC](https://community.auth0.com/t/state-not-included-in-redirect-token-error-state-in-the-token-does-not-match-the-continue-state/112729/2 "2023-08-02T19:53:59Z")

</div>

This person got the same error:

> [@The session token is invalid: State in the token does not match the /continue state](https://community.auth0.com/t/the-session-token-is-invalid-state-in-the-token-does-not-match-the-continue-state/77930):
>
> Hi, I am using passwordless login with email as a provider along with some social providers. Sometimes, I won’t get the chance to capture the first name and the last name of the user. As such, I am trying to implement a progressive profiling flow. I thought about using Actions because it looks to offer exactly what I need. However, I am facing an issue related to session token and I would like some help to figure out what I am missing or doing wrong. Here are the steps I am currently doing: …

Though they did not add what code was missing. I have tried adding a state to the session\_token as such:

```auto
const session_token = api.redirect.encodeToken({
        secret: event.secrets.REDIRECT_SECRET,
        expiresInSeconds: 60, 
        payload: {
          sub: event.user.user_id,
          email: event.user.email,
          continue_uri: `https://${AUTH0_DOMAIN}/continue`,
          state: "abc123"
        },
      });

```

But obviously it is not a valid state, because it was not generated by Auth0 and does not match the /continue state wanted.

I have also tried to exchange the state from `abc123` to `state: event.transaction?.state` but that is also not the correct state to add. The state from the URI is something long like this: `hKFo2SBRNklVMFVPM2FkODh4ZUs4bGhwOWVyUEQtSW5nRTl2NKFuqHJlZGlyZWN0o3RpZNkgNnpzSXdMbzNkRGZluy0tdkowbm5nSG5BM2t5aTdSRkujY2lk2SBFNmdEV3ZmUVlIYmpPT3h3RDM5bk1pNlIzSklVcTQwMg` whereas the state from the transaction is something short like this: `S2NpVk1NU1JlbWFwMWxfY05vbnJIQmphMkNMVAZFcGt4UDNzMHJ5TUxibA==`.

I get either the first error that it is a mismatch, or that the configuration is wrong.

---

_[View the full topic](https://community.auth0.com/t/state-not-included-in-redirect-token-error-state-in-the-token-does-not-match-the-continue-state/112729)._
