Ready to post? First, try searching for your answer.
Hi all,
we’re using passkeys and SMS based MFA.
For some users (test users etc.) we need to be able to dynamically disable MFA.
We use and action and evaluate a property called mfa_enabled
in the user’s app_metadata
:
exports.onExecutePostLogin = async (event, api) => {
const mfaEnabled = event.user.app_metadata?.mfa_enabled;
if (mfaEnabled === false) {
api.multifactor.enable("none");
return;
}
}
This approach works fine for us in other projects.
Now, combining it with passkeys we’re running into an issue: The MFA is skipped as expected but when creating a passkey, the MFA enrollment process is triggered on the first time.
If the user is not creating a passkey and going through the login again for the second time the MFA enrollment process is not started.
We’d expect that api.multifactor.enable("none");
would completely disable MFA (challenge plus enrollment).
Can you help? Thanks!