# Testing onContinuePostLogin from Code Editor

**URL:** <https://community.auth0.com/t/testing-oncontinuepostlogin-from-code-editor/101693>\
**Category:** Get Help\
**Tags:** apis, application\
**Created:** [March 2, 2023, 7:33pm UTC](https://community.auth0.com/t/testing-oncontinuepostlogin-from-code-editor/101693 "2023-03-02T19:33:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![chris.gatzonis](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/chris.gatzonis/32/45082_2.png) [@chris.gatzonis](https://community.auth0.com/u/chris.gatzonis)\
**Post date:** [March 2, 2023, 7:33pm UTC](https://community.auth0.com/t/testing-oncontinuepostlogin-from-code-editor/101693/1 "2023-03-02T19:33:50Z")

</div>

Hello,

I’m developing a custom post login action and I’m wondering if there a way to test run the onContinuePostLogin method in the code editor. When I press run in the test sidebar it always runs the onExecutePostLogin method but haven’t found a way to test run onContinuePostLogin.

Appreciate the help. Thanks.

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [March 2, 2023, 8:08pm UTC](https://community.auth0.com/t/testing-oncontinuepostlogin-from-code-editor/101693/3 "2023-03-02T20:08:41Z")

</div>

Hi @chris.gatzonis,

Welcome to the Auth0 Community!

I understand that you are looking to test a [Redirect Action Flow](https://auth0.com/docs/actions/triggers/post-login/redirect-with-actions), specifically with `onContinuePostLogin`.

To do this, you will need to perform a real login flow to get redirected to your redirect URL. Once that happens, the browser URL should contain a `state` query parameter, which you can take and append to the `/continue` endpoint in the browser.

For example:

```auto
/**
* @param {Event} event - Details about the user and the context in which they are logging in.
* @param {PostLoginAPI} api - Interface whose methods can be used to change the behavior of the login.
*/
exports.onExecutePostLogin = async (event, api) => {
  api.redirect.sendUserTo("https://my-app.exampleco.com");
};

/**
* @param {Event} event - Details about the user and the context in which they are logging in.
* @param {PostLoginAPI} api - Interface whose methods can be used to change the behavior of the login.
*/

exports.onContinuePostLogin = async (event, api) => {
}

```

The user gets redirected to this URL with a randomly generated `state` value:

```auto
https://my-app.exampleco.com/?state=stateABC123

```

Then you can take the `state` and append it to the `/continue` endpoint and paste it into the browser URL with the following format:

```auto
https://{{your_domain}}/continue?state=stateABC123

```

Doing so completes the authentication flow and brings the user back to the correct callback URL of your application.

I hope the explanation was clear!

Please let me know how this goes for you.

Thanks,  
Rueben

---

<div class="post-metadata">

**Author:** ![chris.gatzonis](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/chris.gatzonis/32/45082_2.png) [@chris.gatzonis](https://community.auth0.com/u/chris.gatzonis)\
**Post date:** [March 2, 2023, 8:50pm UTC](https://community.auth0.com/t/testing-oncontinuepostlogin-from-code-editor/101693/4 "2023-03-02T20:50:37Z")

</div>

Thanks [rueben.tiow](https://community.auth0.com/u/rueben.tiow). I was hoping that I could test it directly from the code editor same way I can test onExecutePostLogin from the sidebar but I understand that there is no option for that.

---

<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 16, 2023, 8:50pm UTC](https://community.auth0.com/t/testing-oncontinuepostlogin-from-code-editor/101693/5 "2023-03-16T20:50:39Z")

</div>

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