How to Find the Users MFA Enrollments in Actions

Problem statement

This article describes how to find a user’s MFA enrollments in Actions without making a management API call.

Solution

  1. Navigate to Dashboard > Security > Multi-factor Auth and enable the Customize MFA Factors using Actions setting in Additional Settings

  1. The user’s MFA enrollments are now available with event.user.enrolledFactors in Actions.
exports.onExecutePostLogin = async (event, api) => {
  
  console.log("=================== ENROLLED FACTORS");
  console.log(event.user.enrolledFactors);

};