Skip to content

Commit 150bd0d

Browse files
LZoogdschom
authored andcommitted
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 f99ee3a commit 150bd0d

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

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

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

290290
try {
291291
const { phoneNumber, nationalFormat } =
292-
await this.recoveryPhoneService.hasConfirmed(uid, 4);
292+
// User has successfully set up a recovery phone. Give back the
293+
// full nationalFormat (don't strip it).
294+
await this.recoveryPhoneService.hasConfirmed(uid);
293295
await this.mailer.sendPostAddRecoveryPhoneEmail(
294296
account.emails,
295297
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
@@ -325,6 +325,9 @@ describe('/recovery_phone', () => {
325325

326326
assert.isDefined(resp);
327327
assert.equal(resp.status, 'success');
328+
// Gives back the full national format as the user just successfully
329+
// confirmed the code
330+
assert.equal(resp.nationalFormat, nationalFormat);
328331
assert.equal(mockRecoveryPhoneService.confirmSetupCode.callCount, 1);
329332
assert.equal(
330333
mockRecoveryPhoneService.confirmSetupCode.getCall(0).args[0],

0 commit comments

Comments
 (0)