MFA prompt still shown to the user even after selecting "Remember browser"

I’ve tried the code you’ve suggested but nothing changed, unfortunately:

exports.onExecutePostLogin = async (event, api) => {
    if (event.transaction.protocol === "oauth2-refresh-token") {
        return;
    }

    const userMeta = event.user.user_metadata || {};

    if (userMeta.use_mfa) {
        api.multifactor.enable("any", { allowRememberBrowser: true });
    }
};

My observations:

  • If I comment out this action altogether // api.multifactor.enable("any", { allowRememberBrowser: true }); the user with already configured MFA is prompted MFA each time and does not see “Remember browser” checkmark
  • if this api.multifactor.enable("any", { allowRememberBrowser: true }); is present the user still prompted MFA each time but the checkmark “Remember browser” is visible every other time