Skip to content

Commit 68f8b50

Browse files
authored
Merge pull request #18396 from mozilla/FXA-11166
fix(recovery-phone): Don't strip nationalFormat number after successful setup
2 parents eae4c16 + e56438c commit 68f8b50

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

packages/fxa-auth-server/lib/routes/recovery-phone.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,9 @@ class RecoveryPhoneHandler {
302302

303303
try {
304304
const { phoneNumber, nationalFormat } =
305-
await this.recoveryPhoneService.hasConfirmed(uid, 4);
305+
// User has successfully set up a recovery phone. Give back the
306+
// full nationalFormat (don't strip it).
307+
await this.recoveryPhoneService.hasConfirmed(uid);
306308
await this.mailer.sendPostAddRecoveryPhoneEmail(
307309
account.emails,
308310
account,

packages/fxa-auth-server/test/local/routes/recovery-phone.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,9 @@ describe('/recovery_phone', () => {
355355

356356
assert.isDefined(resp);
357357
assert.equal(resp.status, 'success');
358+
// Gives back the full national format as the user just successfully
359+
// confirmed the code
360+
assert.equal(resp.nationalFormat, nationalFormat);
358361
assert.equal(mockRecoveryPhoneService.confirmSetupCode.callCount, 1);
359362
assert.equal(
360363
mockRecoveryPhoneService.confirmSetupCode.getCall(0).args[0],

0 commit comments

Comments
 (0)