# Api.multifactor.disable

**URL:** <https://community.auth0.com/t/api-multifactor-disable/133145>\
**Category:** Get Help\
**Tags:** mfa-api, mfa\
**Created:** [April 30, 2024, 4:53pm UTC](https://community.auth0.com/t/api-multifactor-disable/133145 "2024-04-30T16:53:46Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ysharat](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ysharat/32/44251_2.png) [@ysharat](https://community.auth0.com/u/ysharat)\
**Post date:** [April 30, 2024, 4:53pm UTC](https://community.auth0.com/t/api-multifactor-disable/133145/1 "2024-04-30T16:53:47Z")

</div>

Hi there,  
For sake of user experience i want to disable the mfa for a specific admin user on my web app if the users comes from the city = california.For any user MFA should be enabled first time later on subsequent visits for this admin user if he was trying to come from california mfa should be disable, i was trying with below(api.multifactor.disable()) wich doesn’t work.pls adcive.

exports.onExecutePostLogin = async (event, api) =\> {  
const city = event.request.geoip.cityName;  
if (city == ‘California’) {  
api.multifactor.enable(“none”);  
}

---

<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:** [May 1, 2024, 12:03am UTC](https://community.auth0.com/t/api-multifactor-disable/133145/3 "2024-05-01T00:03:30Z")

</div>

Hi @ysharat,

There isn’t a `api.multifactor.disable()` method.

Instead, you must use the `api.multifactor.enable()` method.

For example:

```auto
exports.onExecutePostLogin = async (event, api) => {
  const city = event.request.geoip.cityName;
  if (city !== ‘California’) {
    api.multifactor.enable('any', { allowRememberBrowser: false });
  }
}

```

Please keep me posted on how this goes for you.

Thanks,  
Rueben

---

<div class="post-metadata">

**Author:** ![ysharat](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ysharat/32/44251_2.png) [@ysharat](https://community.auth0.com/u/ysharat)\
**Post date:** [May 1, 2024, 5:04am UTC](https://community.auth0.com/t/api-multifactor-disable/133145/4 "2024-05-01T05:04:39Z")

</div>

Nope, it doens’t work. However Ignore it for a while, will get back to you on this with the detailed requirment.

---

<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:** [May 1, 2024, 6:05pm UTC](https://community.auth0.com/t/api-multifactor-disable/133145/5 "2024-05-01T18:05:17Z")

</div>

Hi @ysharat,

Thanks for the reply.

Could you share with me what you experienced when it did not work? Does MFA stay enabled for the user?

If so, you might need to turn MFA off and use the Action script to enable MFA. This tends to provide more control over the MFA experience for your users.

And sure, I can wait for your update on the detailed requirements.

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:** [May 17, 2024, 6:26pm UTC](https://community.auth0.com/t/api-multifactor-disable/133145/6 "2024-05-17T18:26:13Z")

</div>

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