Skip to content

feat(react): create use user mfa service hook and types#270

Open
NaveenChand755 wants to merge 7 commits intomainfrom
feat/mfa-service-hook
Open

feat(react): create use user mfa service hook and types#270
NaveenChand755 wants to merge 7 commits intomainfrom
feat/mfa-service-hook

Conversation

@NaveenChand755
Copy link
Copy Markdown
Contributor

@NaveenChand755 NaveenChand755 commented May 7, 2026

Summary:
Adds useUserMFAService, an internal TanStack Query hook that handles MFA data fetching and mutations (enroll, delete, confirm). Separates the API layer from UI state as the foundation for useUserMFA in the next PR.

Why

The existing MFA implementation bundles data fetching and UI state together, making the API layer hard to test in isolation. This extracts it as a standalone hook.

What

useUserMFAService with factorsQuery, enrollMutation, deleteMutation, confirmEnrollmentMutation
UseUserMFAServiceReturn type + export from hooks/index.ts
10 unit tests

Packages

  • packages/core
  • packages/react
  • examples

References

Testing

How can this be verified? Note anything intentionally not covered by tests and why.

  • This change adds unit test coverage
  • Tested for both SPA and RWA flows, all example apps working
  • All existing and new tests complete without errors

Checklist

  • Breaking change
  • Requires docs update
  • Backward compatible

Contributing

@NaveenChand755 NaveenChand755 changed the title feat(react): create use user service hook and types feat(react): create use user mfa service hook and types May 7, 2026
@NaveenChand755 NaveenChand755 added the refactor Restructuring existing code and logic to reduce technical debt and improve quality label May 7, 2026
Base automatically changed from feat/refactor-core-for-usermfa to main May 8, 2026 07:35
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.47%. Comparing base (7f720a1) to head (8808f44).
⚠️ Report is 11 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #270      +/-   ##
==========================================
+ Coverage   89.42%   89.47%   +0.04%     
==========================================
  Files         159      160       +1     
  Lines       13329    13388      +59     
  Branches     1435     1435              
==========================================
+ Hits        11920    11979      +59     
  Misses       1409     1409              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

Labels

refactor Restructuring existing code and logic to reduce technical debt and improve quality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants