Skip to content

Commit e56438c

Browse files
committed
fix(recovery-phone): Don't strip nationalFormat number after successful setup
Because: * We are stripping the nationalFormat from Twilio to only return 4 digits, even though the response in question is for a successful recovery phone set up This commit: * Returns the full nationalFormat in this case, as the user is logged in and confirmed their code fixes FXA-11162 fixes FXA-11166
1 parent 39a64bd commit e56438c

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
@@ -303,7 +303,9 @@ class RecoveryPhoneHandler {
303303

304304
try {
305305
const { phoneNumber, nationalFormat } =
306-
await this.recoveryPhoneService.hasConfirmed(uid, 4);
306+
// User has successfully set up a recovery phone. Give back the
307+
// full nationalFormat (don't strip it).
308+
await this.recoveryPhoneService.hasConfirmed(uid);
307309
await this.mailer.sendPostAddRecoveryPhoneEmail(
308310
account.emails,
309311
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
@@ -342,6 +342,9 @@ describe('/recovery_phone', () => {
342342

343343
assert.isDefined(resp);
344344
assert.equal(resp.status, 'success');
345+
// Gives back the full national format as the user just successfully
346+
// confirmed the code
347+
assert.equal(resp.nationalFormat, nationalFormat);
345348
assert.equal(mockRecoveryPhoneService.confirmSetupCode.callCount, 1);
346349
assert.equal(
347350
mockRecoveryPhoneService.confirmSetupCode.getCall(0).args[0],

0 commit comments

Comments
 (0)