Repository navigation
fix(users): report the recovery code factor when listing user MFA factors - #13531
Merged
Merged
Conversation
…tors GET /v1/users/:userId/mfa/factors omitted the recoveryCode key entirely, so the response model fell back to false even for users who had generated recovery codes. GET /v1/account/mfa/factors computes it from the user's mfaRecoveryCodes attribute, so the two endpoints disagreed for the same user. Compute the factor the same way on the users route.
Contributor
Greptile SummaryThis PR aligns the Users MFA APIs with their Account counterparts:
Confidence Score: 5/5The PR appears safe to merge; the MFA factor calculation and creation status are consistent with the corresponding Account behavior and are covered end to end. No actionable correctness, security, or repository-rule violations remain in the current PR diff. Important Files Changed
Reviews (3): Last reviewed commit: "Merge branch 'main' into fix/users-mfa-r..." | Re-trigger Greptile |
✨ Benchmark resultsComparing
Per-scenario breakdown & investigation detailsMetrics below reflect the current branch (after). Δ P95 compares against the base.
Top API waits (after)
|
The SDK method declares STATUS_CODE_CREATED for both of its responses, but the action never set it, so the route answered 200. The account equivalent sets it, so the two surfaces disagreed here as well.
Meldiron
approved these changes
Sep 8, 2026
2 tasks done
2 of 4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #10927
What does this PR do?
Makes Users MFA factors report whether recovery codes exist, using the same calculation as Account. Previously the omitted
recoveryCodekey defaulted to false even after codes were generated.Also returns the documented 201 status when creating user recovery codes, matching the Account route and the existing SDK response definition.
Test Plan
testListMFAFactorsRecoveryCodechecks both Users and Account before and after generating recovery codes and asserts the creation status.