Skip to content

Conversation

@avanscoy
Copy link
Contributor

@avanscoy avanscoy commented Dec 9, 2025

By submitting a PR to this repository, you agree to the terms within the Auth0 Code of Conduct. Please see the contributing guidelines for how to create and submit a high-quality PR for this repo.

Description

Requested update to clarify Adaptive MFA template and use of email as a secondary factor.

References

Docs Request

Testing

Local

  • This change adds test coverage for new/changed/fixed functionality

Checklist

  • I have added documentation for new/changed functionality in this PR or in auth0.com/docs
  • All active GitHub checks for tests, formatting, and security are passing
  • The correct base branch is being used, if not the default branch

@avanscoy avanscoy added main-docs Changes related to auth0's main docs (https://auth0.com/docs) DO NOT MERGE labels Dec 9, 2025
nick-gagliardi
nick-gagliardi previously approved these changes Dec 9, 2025
Comment on lines +620 to +621
* The [`api.multifactor.enable`](/docs/customize/actions/explore-triggers/signup-and-login-triggers/login-trigger/post-login-api-object#api-multifactor) Action trigger to handle both enrollment and issues configured MFA challenges at the end of the login flow.
* The [`event.user.multifactor`](/docs/customize/actions/explore-triggers/signup-and-login-triggers/login-trigger/post-login-event-object) Actions trigger with the user's enrolled factors.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Actions trigger" or "Action trigger"? (not sure which one is the right way to refer to the product)

* The [`event.user.multifactor`](/docs/customize/actions/explore-triggers/signup-and-login-triggers/login-trigger/post-login-event-object) Actions trigger with the user's enrolled factors.

<Callout icon="file-lines" color="#0EA5E9" iconType="regular">
Since `email` notifications are not an independent factor, the condition `const canPromptMfa = event.user.multifactor && event.user.multifactor.length > 0;` will return `false` if the user only has `email` as a factor. To learn more, read [Configure Email Notifications for MFA](/docs/secure/multi-factor-authentication/multi-factor-authentication-factors/configure-email-notifications-for-mfa).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Since `email` notifications are not an independent factor, the condition `const canPromptMfa = event.user.multifactor && event.user.multifactor.length > 0;` will return `false` if the user only has `email` as a factor. To learn more, read [Configure Email Notifications for MFA](/docs/secure/multi-factor-authentication/multi-factor-authentication-factors/configure-email-notifications-for-mfa).
Since `email` notifications are not an independent factor, the condition `event.user.multifactor && event.user.multifactor.length > 0` will return `false` if the user only has `email` as a factor. To learn more, read [Configure Email Notifications for MFA](/docs/secure/multi-factor-authentication/multi-factor-authentication-factors/configure-email-notifications-for-mfa).

Comment on lines +673 to +679
// It only makes sense to prompt for MFA when the user has at least one
// enrolled MFA factor.
const canPromptMfa = event.user.enrolledFactors && event.user.enrolledFactors.length >0;

if (shouldPromptMfa && canPromptMfa) {
api.authentication.challengeWithAny([ {type: "email"}, {type:"phone"} ]);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// It only makes sense to prompt for MFA when the user has at least one
// enrolled MFA factor.
const canPromptMfa = event.user.enrolledFactors && event.user.enrolledFactors.length >0;
if (shouldPromptMfa && canPromptMfa) {
api.authentication.challengeWithAny([ {type: "email"}, {type:"phone"} ]);
}
// It only makes sense to prompt for MFA when the user has at least one
// enrolled MFA factor.
const canPromptMfa = event.user.enrolledFactors && event.user.enrolledFactors.length > 0;
if (shouldPromptMfa && canPromptMfa) {
api.authentication.challengeWithAny([ {type: "email"}, {type:"phone"} ]);
}

### Adaptive MFA template

This template provides an example and starting point for how to build a custom business flow using individual risk assessments.
This template provides an example and starting point for how to build a custom business flow using individual risk assessments. In this example, we use:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This template provides an example and starting point for how to build a custom business flow using individual risk assessments. In this example, we use:
This template provides an example and starting point for how to build a custom business flow using individual risk assessments. This example uses:

This template provides an example and starting point for how to build a custom business flow using individual risk assessments.
This template provides an example and starting point for how to build a custom business flow using individual risk assessments. In this example, we use:

* The [`api.multifactor.enable`](/docs/customize/actions/explore-triggers/signup-and-login-triggers/login-trigger/post-login-api-object#api-multifactor) Action trigger to handle both enrollment and issues configured MFA challenges at the end of the login flow.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* The [`api.multifactor.enable`](/docs/customize/actions/explore-triggers/signup-and-login-triggers/login-trigger/post-login-api-object#api-multifactor) Action trigger to handle both enrollment and issues configured MFA challenges at the end of the login flow.
* The [`api.multifactor.enable`](/docs/customize/actions/explore-triggers/signup-and-login-triggers/login-trigger/post-login-api-object#api-multifactor) Action trigger to handle both enrollment and issue configured MFA challenges at the end of the login flow.

``` javascript
// It only makes sense to prompt for MFA when the user has at least one
// enrolled MFA factor.
const canPromptMfa = event.user.enrolledFactors && event.user.enrolledFactors.length >0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this change also uses event.user.enrolledFactors rather than event.user.multifactor, so it would be good to have an explanation of the difference or the reason for the change. is it because enrolledFactors counts email and multifactor doesn't?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DO NOT MERGE main-docs Changes related to auth0's main docs (https://auth0.com/docs)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants