# Require MFA Only at Login

**URL:** <https://community.auth0.com/t/require-mfa-only-at-login/185923>\
**Category:** Get Help\
**Tags:** one-time-password-otp-factor, mfa\
**Created:** [April 25, 2025, 12:35am UTC](https://community.auth0.com/t/require-mfa-only-at-login/185923 "2025-04-25T00:35:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![t.fukao](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/t.fukao/32/61052_2.png) [@t.fukao](https://community.auth0.com/u/t.fukao)\
**Post date:** [April 25, 2025, 12:35am UTC](https://community.auth0.com/t/require-mfa-only-at-login/185923/1 "2025-04-25T00:35:06Z")

</div>

When MFA is enabled, I’m prompted to enter a one-time password every time I reload the browser.

Is it possible to require the one-time password only at the time of login?

I’m using Auth0 Vue SDK.  
And the MFA is called within a Post Login Action as shown below.

```auto
exports.onExecutePostLogin = async (event, api) => {
    if (event.user.user_metadata.use_mfa == 1){
        api.multifactor.enable('guardian', { allowRememberBrowser: false });
    }
};

```

---

<div class="post-metadata">

**Author:** ![remus.ivan](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/remus.ivan/32/68771_2.png) [@remus.ivan](https://community.auth0.com/u/remus.ivan)\
**Post date:** [April 25, 2025, 11:37pm UTC](https://community.auth0.com/t/require-mfa-only-at-login/185923/3 "2025-04-25T23:37:47Z")

</div>

Hi @t.fukao,

Welcome back to the Auth0 Community!

The reason the user is prompted for MFA again is that **Actions** are executed during each login, which includes both standard login and **silent authentication** requests or **Refresh Token** exchanges.

To ensure that your Action does not run on subsequent logins, you can enforce your action code to check for:

1. A refresh token exchange

```auto
if(event.transaction.protocol === "oauth2-refresh-token"){
        return;
  }

```

1. A silent authentication

```auto
if(event.request.query.response_mode === 'web_message'){
       return;
 }

```

I hope this helps!  
Best regards,  
Remus

---

<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 9, 2025, 11:38pm UTC](https://community.auth0.com/t/require-mfa-only-at-login/185923/4 "2025-05-09T23:38:44Z")

</div>

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