# onContinuePostLogin is not triggering after MFA

**URL:** <https://community.auth0.com/t/oncontinuepostlogin-is-not-triggering-after-mfa/114039>\
**Category:** Get Help\
**Tags:** mfa-api, mfa\
**Created:** [August 20, 2023, 4:55am UTC](https://community.auth0.com/t/oncontinuepostlogin-is-not-triggering-after-mfa/114039 "2023-08-20T04:55:11Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![kiran.b.chandran](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/kiran.b.chandran/32/35578_2.png) [@kiran.b.chandran](https://community.auth0.com/u/kiran.b.chandran)\
**Post date:** [August 20, 2023, 4:55am UTC](https://community.auth0.com/t/oncontinuepostlogin-is-not-triggering-after-mfa/114039/1 "2023-08-20T04:55:11Z")

</div>

Hi All,

I am using Actions to enable MFA in the onExecutePostLogin. But after successful MFA validation the onContinuePostLogin method is not triggered. I need to re-direct the user to a different URL after this.

Is there any way I can re-direct the user to a different URL after successful MFA? Can I do this with actions?

```auto
exports.onExecutePostLogin = async (event, api) => {

  api.multifactor.enable("any");
};

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

```

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:** [August 22, 2023, 5:54am UTC](https://community.auth0.com/t/oncontinuepostlogin-is-not-triggering-after-mfa/114039/3 "2023-08-22T05:54:38Z")

</div>

Hi @kiran.b.chandran,

The `onContinuePostLogin` function will only trigger if you first redirected your user to another URL.

Then you must call the `/continue` endpoint to complete the authentication flow.

For example:

`https://{yourAuth0Domain}/continue?state=THE_ORIGINAL_STATE`

Please see [Redirect with Actions](https://auth0.com/docs/customize/actions/flows-and-triggers/login-flow/redirect-with-actions#resume-the-authentication-flow).

> [@kiran.b.chandran](#):
>
> Is there any way I can re-direct the user to a different URL after successful MFA? Can I do this with actions?

You need to call the `api.redirect.sendUserTo()` method to redirect your users.

Thanks,  
Rueben

---

<div class="post-metadata">

**Author:** ![kiran.b.chandran](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/kiran.b.chandran/32/35578_2.png) [@kiran.b.chandran](https://community.auth0.com/u/kiran.b.chandran)\
**Post date:** [August 22, 2023, 6:30am UTC](https://community.auth0.com/t/oncontinuepostlogin-is-not-triggering-after-mfa/114039/4 "2023-08-22T06:30:05Z")

</div>

Hi @rueben.tiow,

I need to get a callback to onContinuePostLogin after completing the Auth0 Default MFA.  
So to which URL I should re-direct the user to get this behavior?

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:** [August 22, 2023, 4:39pm UTC](https://community.auth0.com/t/oncontinuepostlogin-is-not-triggering-after-mfa/114039/5 "2023-08-22T16:39:17Z")

</div>

Hi @kiran.b.chandran,

> [@kiran.b.chandran](#):
>
> So to which URL I should re-direct the user to get this behavior?

You need to redirect your users to whatever URL you prefer using the `api.redirect.sendUserTo()` method.

Once you get redirected to that page, you can send the user back to Auth0 to resume authentication by calling `https://{yourAuth0Domain}/continue?state=THE_ORIGINAL_STATE`.

Then at this point, you can initiate your Multi-factor Authentication process.

See below:

```auto
exports.onExecutePostLogin = async (event, api) => {
  api.redirect.sendUserTo("https://yourURL.com");
};

exports.onContinuePostLogin = async (event, api) => {
  api.multifactor.enable('any')

```

Thanks,  
Rueben

---

<div class="post-metadata">

**Author:** ![kiran.b.chandran](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/kiran.b.chandran/32/35578_2.png) [@kiran.b.chandran](https://community.auth0.com/u/kiran.b.chandran)\
**Post date:** [August 22, 2023, 5:36pm UTC](https://community.auth0.com/t/oncontinuepostlogin-is-not-triggering-after-mfa/114039/6 "2023-08-22T17:36:10Z")

</div>

Hi @rueben.tiow,

The issue is if I use api.multifactor.enable(‘any’) in onExecutePostLogin the onContinuePostLogin is not triggered.

Is there any way to make this work?

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:** [August 22, 2023, 7:35pm UTC](https://community.auth0.com/t/oncontinuepostlogin-is-not-triggering-after-mfa/114039/7 "2023-08-22T19:35:36Z")

</div>

Hi @kiran.b.chandran,

Unfortunately, no. This is not possible.

You could leverage the Callback URL (redirect\_uri) if you want to redirect the user after MFA.

Thanks,  
Rueben

---

<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:** [September 5, 2023, 7:36pm UTC](https://community.auth0.com/t/oncontinuepostlogin-is-not-triggering-after-mfa/114039/8 "2023-09-05T19:36:01Z")

</div>

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