# How to disable MFA using actions?

**URL:** <https://community.auth0.com/t/how-to-disable-mfa-using-actions/100687>\
**Category:** Get Help\
**Tags:** mfa-api, mfa\
**Created:** [February 16, 2023, 9:32pm UTC](https://community.auth0.com/t/how-to-disable-mfa-using-actions/100687 "2023-02-16T21:32:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![naveen.shambugowda](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@naveen.shambugowda](https://community.auth0.com/u/naveen.shambugowda)\
**Post date:** [February 16, 2023, 9:32pm UTC](https://community.auth0.com/t/how-to-disable-mfa-using-actions/100687/1 "2023-02-16T21:32:52Z")

</div>

We have MFA turned on at the tenant level but want to selectively disable MFA based on connectionStrategy or email. How can this be done using actions?

The [post-login API object](https://auth0.com/docs/customize/actions/flows-and-triggers/login-flow/api-object) has no method to disable MFA

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [February 17, 2023, 7:50am UTC](https://community.auth0.com/t/how-to-disable-mfa-using-actions/100687/2 "2023-02-17T07:50:24Z")

</div>

Hey there!

Here’s one of our FAQs for enabling MFA for specific set of users:

[https://community.auth0.com/t/how-to-enable-mfa-for-a-subset-of-users/87505](https://community.auth0.com/t/how-to-enable-mfa-for-a-subset-of-users/87505)

Have you had a chance to check it out?

---

<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 3, 2023, 7:51am UTC](https://community.auth0.com/t/how-to-disable-mfa-using-actions/100687/3 "2023-03-03T07:51:18Z")

</div>

The FAQ shows the sample for the reverse case, like how to force MFA for a specific set of users. A similar action like the following can help to disable MFA for a specific set of users by using `none` instead of `any`.

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

  // uncomment the following if clause in case you want to skip a second factor only for users that have app_metadata.skip_mfa === true

  if (event.user.app_metadata?.skip_mfa){
    api.multifactor.enable('none', {allowRememberBrowser: false});
  }
};

```
