Skip to content

Commit 14fae25

Browse files
committed
wip to squash into enter mfa
1 parent 06a700c commit 14fae25

3 files changed

Lines changed: 12 additions & 3 deletions

File tree

src/components/enter-mfa/enter-mfa-controller.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ export function enterMfaTemplateParametersFromRequest(req: Request): any {
8888
const hasMultipleMfaMethods = req.session.user.mfaMethods?.length > 1;
8989

9090
return {
91-
phoneNumber: activeMfaMethod.phoneNumber,
91+
phoneNumber: activeMfaMethod.redactedPhoneNumber,
9292
isAccountRecoveryPermitted: req.session.user.isAccountRecoveryPermitted,
9393
hasMultipleMfaMethods,
9494
mfaIssuePath: hasMultipleMfaMethods

src/components/enter-mfa/tests/enter-mfa-controller.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ describe("enter mfa controller", () => {
4747

4848
req.session.user.mfaMethods = buildMfaMethods({
4949
id: TEST_DEFAULT_MFA_ID,
50-
phoneNumber: TEST_PHONE_NUMBER,
50+
redactedPhoneNumber: TEST_PHONE_NUMBER,
5151
});
5252
res.render = sinon.spy(res.render);
5353
});

src/components/enter-mfa/tests/enter-mfa-integration.test.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,16 @@ describe("Integration:: enter mfa", () => {
2828
let baseApi: string;
2929
const DEFAULT_PHONE_NUMBER = "7867";
3030
const BACKUP_PHONE_NUMBER = "1234";
31+
const DEFAULT_PHONE_NUMBER_ID = "test-id";
32+
const BACKUP_PHONE_NUMBER_ID = "test-id-backup";
3133

3234
async function setupStubbedApp(
3335
partialMfaMethods: {
3436
redactedPhoneNumber?: string;
37+
id: string;
3538
}[] = [
3639
{
40+
id: DEFAULT_PHONE_NUMBER_ID,
3741
redactedPhoneNumber: DEFAULT_PHONE_NUMBER,
3842
},
3943
],
@@ -54,6 +58,7 @@ describe("Integration:: enter mfa", () => {
5458
req.session.user = {
5559
email: "test@test.com",
5660
mfaMethods: buildMfaMethods(partialMfaMethods),
61+
activeMfaMethodId: DEFAULT_PHONE_NUMBER_ID,
5762
journey: getPermittedJourneyForPath(PATH_NAMES.ENTER_MFA),
5863
};
5964
next();
@@ -128,6 +133,7 @@ describe("Integration:: enter mfa", () => {
128133
partialMfaMethods: [
129134
{
130135
redactedPhoneNumber: DEFAULT_PHONE_NUMBER,
136+
id: DEFAULT_PHONE_NUMBER_ID,
131137
},
132138
],
133139
isAccountRecoveryPermitted: false,
@@ -137,6 +143,7 @@ describe("Integration:: enter mfa", () => {
137143
partialMfaMethods: [
138144
{
139145
redactedPhoneNumber: DEFAULT_PHONE_NUMBER,
146+
id: DEFAULT_PHONE_NUMBER_ID,
140147
},
141148
],
142149
isAccountRecoveryPermitted: true,
@@ -149,9 +156,11 @@ describe("Integration:: enter mfa", () => {
149156
partialMfaMethods: [
150157
{
151158
redactedPhoneNumber: DEFAULT_PHONE_NUMBER,
159+
id: DEFAULT_PHONE_NUMBER_ID,
152160
},
153161
{
154-
redactedPhoneNumber: BACKUP_PHONE_NUMBER,
162+
authApp: BACKUP_PHONE_NUMBER,
163+
id: BACKUP_PHONE_NUMBER_ID,
155164
},
156165
],
157166
isAccountRecoveryPermitted: true,

0 commit comments

Comments
 (0)