Skip to content

Conversation

@vpomerleau
Copy link
Contributor

Because

  • We will be wrapping TOTP creation flow with an MFA guard, this sets up the backend support

This pull request

  • Adds MFA-variants of the TOTP setup endpoints
  • Adds and updates unit tests
  • Adds integration tests for the MFA routes
  • Adds docs for the new endpoints and a bit of extra docs for the original session-token-based endpoints
  • Adds a little mail helper to obtain the MFA code in tests

Issue that this pull request solves

Issue: FXA-12229

Checklist

Put an x in the boxes that apply

  • My commit is GPG signed.
  • If applicable, I have modified or added tests which pass locally.
  • I have added necessary documentation (if appropriate).
  • I have verified that my changes render correctly in RTL (if appropriate).

Screenshots (Optional)

Please attach the screenshots of the changes made in case of change in user interface.

Other information (Optional)

This is the backend portion of the work needed for FXA-12229

Copy link
Member

@toufali toufali left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the additional documentation!

I tried running the tests locally to confirm working as expected, but it doesn't look like the tests ran via nx test-integration fxa-auth-server ? I'm probably running the wrong suite...

@vpomerleau vpomerleau force-pushed the FXA-12229-backend branch 2 times, most recently from 19a22a8 to a038052 Compare September 23, 2025 21:32
? `${config.serviceName} - ${environment}`
: `${config.serviceName}`;

// Shared handlers for TOTP replace flows (used by legacy and /mfa routes)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Move the handler back into the sessionToken route to follow the preferred pattern

@vpomerleau
Copy link
Contributor Author

Thanks @toufali! I pushed changes up based on feedback in #19432 that included this commit to enable the frontend work.

Because:

* We will be wrapping TOTP creation flow with an MFA guard, this sets up the backend support

This commit:

* Adds MFA-variants of the TOTP setup endpoints
* Adds and updates unit tests
* Adds integration tests for the MFA routes
* Adds docs for the new endpoints and a bit of extra docs for the original session-token-based endpoints
* Adds a little mail helper to obtain the MFA code in tests

Issue #FXA-12229
});
});

// MFA-prefixed routes
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We are removing these tests - they duplicate the session token version of the routes (shared handler)

},
},
handler: async function (request) {
return routes
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks

Copy link
Contributor

@dschom dschom left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@vpomerleau vpomerleau merged commit 9e4ad95 into main Sep 24, 2025
19 checks passed
@vpomerleau vpomerleau deleted the FXA-12229-backend branch September 24, 2025 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants