refactor: remove the legacy MFA methods from the auth client - #1627
Conversation
📝 WalkthroughWalkthroughThe change removes legacy MFA authentication methods and types from core, hooks, and web adapters. Examples now use ChangesMFA API migration
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
EXAMPLES.md (1)
2775-2777: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winRemove the blank lines between adjacent blockquotes.
markdownlint-cli2reports MD028 at Lines 2775 and 2777. Remove these blank lines so the documentation lint warning is cleared.Proposed fix
> **Platform Support:** iOS and Android. This option is ignored on web. - > **Warning:** On Android, `ephemeralSession` and [`useTrustedWebActivity`](`#trusted-web-activity-android`) are effectively mutually exclusive. A Trusted Web Activity does not support ephemeral browsing, so if you enable both, TWA takes precedence and the session will **not** be ephemeral. Pick one. - > **Note:** Android support for ephemeral sessions was added in v6. In earlier versions the option was accepted but only took effect on iOS.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@EXAMPLES.md` around lines 2775 - 2777, Remove the blank lines separating adjacent blockquote lines in the Android warning near the ephemeralSession and useTrustedWebActivity documentation, keeping the blockquote content unchanged so markdownlint MD028 passes.Source: Linters/SAST tools
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@EXAMPLES.md`:
- Around line 2775-2777: Remove the blank lines separating adjacent blockquote
lines in the Android warning near the ephemeralSession and useTrustedWebActivity
documentation, keeping the blockquote content unchanged so markdownlint MD028
passes.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 6d88af9e-9c24-48f4-9419-8b31ec164259
📒 Files selected for processing (2)
EXAMPLES.mdMIGRATION_GUIDE.md
🚧 Files skipped from review as they are similar to previous changes (1)
- MIGRATION_GUIDE.md
Changes
Removes the four MFA methods from the auth client, completing the move to the dedicated
mfaclient. They were deprecated on the v5.x line first, so consumers upgrading from a recent v5 release will already have seen the warnings.Gone from
auth0.auth:loginWithOTP(),loginWithOOB(),loginWithRecoveryCode(), andmultifactorChallenge(). The equivalents onuseAuth0()go with them —authorizeWithOTP,authorizeWithOOB,authorizeWithRecoveryCode, andsendMultifactorChallenge— as do the now-orphanedLoginOtpParameters,LoginOobParameters,LoginRecoveryCodeParameters,MfaChallengeParameters, andMfaChallengeResponsetypes.auth0.authauth0.mfaloginWithOTP({ mfaToken, otp })verify({ mfaToken, otp })loginWithOOB({ mfaToken, oobCode, bindingCode })verify({ mfaToken, oobCode, bindingCode })loginWithRecoveryCode({ mfaToken, recoveryCode })verify({ mfaToken, recoveryCode })multifactorChallenge({ mfaToken, authenticatorId })challenge({ mfaToken, authenticatorId })Nothing is lost in the move:
verify()is a superset of the threeloginWith*methods, since it also acceptsscopeandaudiencefor the returned credentials, and themfaclient additionally supports listing and enrolling authenticators. It is implemented on iOS, Android, and web.One migration is not a straight rename, and the migration guide calls it out:
multifactorChallenge()treatedauthenticatorIdas optional and let Auth0 pick a default factor, whereasmfa.challenge()requires it. Anyone relying on that needs to callmfa.getAuthenticators({ mfaToken })first and pass an explicit id — with a length check, since a user can reachMFA_REQUIREDwith nothing enrolled.Summary by CodeRabbit
Breaking Changes
Documentation