# MFA is always required

**URL:** <https://community.auth0.com/t/mfa-is-always-required/150997>\
**Category:** Get Help\
**Tags:** one-time-password-otp-factor, mfa\
**Created:** [November 5, 2024, 11:41am UTC](https://community.auth0.com/t/mfa-is-always-required/150997 "2024-11-05T11:41:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![joao.roberto](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/joao.roberto/32/56743_2.png) [@joao.roberto](https://community.auth0.com/u/joao.roberto)\
**Post date:** [November 5, 2024, 11:41am UTC](https://community.auth0.com/t/mfa-is-always-required/150997/1 "2024-11-05T11:41:58Z")

</div>

Hi,

I have a post-login action that prompts OTP for certain users. It was working for a long time and now all users are being prompted. My tenant’s configuration didn’t change, the action code is the same… Has anything changed on Auth0?

---

<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:** [November 6, 2024, 6:28pm UTC](https://community.auth0.com/t/mfa-is-always-required/150997/3 "2024-11-06T18:28:30Z")

</div>

Hi @joao.roberto,

I just checked your tenant and found that you have the _Require Multi-factor Auth_ option set to **Never** and a post-login action script that is triggering MFA conditionally.

I have checked your post-login action script and found that it might be responsible for triggering MFA for all other users.

While I cannot check this myself, I suggest that you ensure that your `api.multifactor.enable()` methods are triggered correctly.

It might also be worth using the [Real-time Webtask Logs Extension](https://auth0.com/docs/customize/extensions/real-time-webtask-logs) to debug your script as you execute it during a login attempt. This way, you can include `console.log()` statements to trace the events happening. You could cross-reference those login events to your [Auth0 Logs](https://manage.auth0.com/#/logs) to verify the behavior.

Thanks,  
Rueben

---

<div class="post-metadata">

**Author:** ![joao.roberto](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/joao.roberto/32/56743_2.png) [@joao.roberto](https://community.auth0.com/u/joao.roberto)\
**Post date:** [November 6, 2024, 7:36pm UTC](https://community.auth0.com/t/mfa-is-always-required/150997/4 "2024-11-06T19:36:22Z")

</div>

Hi @rueben.tiow, thanks for the reply.

I added a `console.log('should bypass MFA')` line to the post-login action and ran the Real-time Logs extension. In the extension log, that console string was printed (it means also that `api.multifactor.enable('none');` ran). But I am still prompted on MFA.

---

<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:** [January 22, 2025, 9:24pm UTC](https://community.auth0.com/t/mfa-is-always-required/150997/5 "2025-01-22T21:24:07Z")

</div>

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