When a user logs into the system with MFA enabled and toggles the “Remember this device for 30 days” checkbox, I expect the MFA prompt to be skipped the next time the user logs into the app from the same browser. However, the MFA prompt is still being shown.
Setup :
In Security → MFA Auth:
- One-time Password (Google Authenticator) : enabled
Other factors are disabled - Require Multi-factor Auth: Never
- Customize MFA Actors using Actions: disabled (toggling this didn’t affect the result)
Post-login Action:
exports.onExecutePostLogin = async (event, api) => {
const userMeta = event.user.user_metadata || {};
if (userMeta.use_mfa) {
api.multifactor.enable("any", { allowRememberBrowser: true });
}
};
We set { use_mfa: true }
to user_metadata
for users that need MFA enabled.
Steps to reproduce:
- Log out from the app
- Enter username/password
- Check the “Remember this device for 30 days” option, then enter the OTP code from Google Authenticator
- Log out from the app
- Enter username/password again
Expected:
- The user should be redirected to the web app and should not need to enter MFA again, since the “Remember this device for 30 days” option was selected previously in the Auth0 Guardian form.
Actual:
- The user needs to enter MFA again, though the “Remember this device for 30 days” option is not present this time.
What’s interesting is that after logging out and logging in a second time, the MFA prompt appears, but now the “Remember this device for 30 days” option is visible again.
Please help me understand why MFA is not being skipped when logging in from the same browser. Let me know if you need any additional information.