From aec4645caa34578f8a2fb736392ddbf3836a2383 Mon Sep 17 00:00:00 2001 From: Aidan Comer Date: Tue, 7 Jan 2025 13:13:09 +0000 Subject: [PATCH] AUT-3921: Change content for auth app mfa reset with IPV --- .../enter-authenticator-app-code-controller.ts | 1 + src/components/enter-authenticator-app-code/index.njk | 8 ++++++++ .../tests/enter-authenticator-app-code-controller.test.ts | 5 +++++ src/locales/cy/translation.json | 2 ++ src/locales/en/translation.json | 2 ++ 5 files changed, 18 insertions(+) diff --git a/src/components/enter-authenticator-app-code/enter-authenticator-app-code-controller.ts b/src/components/enter-authenticator-app-code/enter-authenticator-app-code-controller.ts index 534acd742..d4ae631e0 100644 --- a/src/components/enter-authenticator-app-code/enter-authenticator-app-code-controller.ts +++ b/src/components/enter-authenticator-app-code/enter-authenticator-app-code-controller.ts @@ -95,6 +95,7 @@ export function enterAuthenticatorAppCodeGet( return res.render(templateName, { isAccountRecoveryPermitted: isAccountRecoveryPermittedForUser, + supportMfaResetWithIpv: supportMfaResetWithIpv(), mfaResetPath, }); }; diff --git a/src/components/enter-authenticator-app-code/index.njk b/src/components/enter-authenticator-app-code/index.njk index 163d231fe..2b7d9d8d0 100644 --- a/src/components/enter-authenticator-app-code/index.njk +++ b/src/components/enter-authenticator-app-code/index.njk @@ -14,6 +14,7 @@ + {{ govukInput({ label: { @@ -42,10 +43,17 @@ {% if isAccountRecoveryPermitted === true or isAccountRecoveryPermitted === "true" %} {% set detailsHTML %} + {% if supportMfaResetWithIpv === true or supportMfaResetWithIpv === "true" %} +

+ {{'pages.enterAuthenticatorAppCode.details.text1MfaResetWithIpv' | translate}} + {{'pages.enterAuthenticatorAppCode.details.text2MfaResetWithIpv'| translate}}{{'pages.enterAuthenticatorAppCode.details.text3' | translate}} +

+ {% else %}

{{'pages.enterAuthenticatorAppCode.details.text1' | translate}} {{'pages.enterAuthenticatorAppCode.details.text2'| translate}}{{'pages.enterAuthenticatorAppCode.details.text3' | translate}}

+ {% endif %} {% endset %} {{ govukDetails({ diff --git a/src/components/enter-authenticator-app-code/tests/enter-authenticator-app-code-controller.test.ts b/src/components/enter-authenticator-app-code/tests/enter-authenticator-app-code-controller.test.ts index b91bdf478..5570c4316 100644 --- a/src/components/enter-authenticator-app-code/tests/enter-authenticator-app-code-controller.test.ts +++ b/src/components/enter-authenticator-app-code/tests/enter-authenticator-app-code-controller.test.ts @@ -71,6 +71,7 @@ describe("enter authenticator app code controller", () => { "enter-authenticator-app-code/index.njk", { isAccountRecoveryPermitted: true, + supportMfaResetWithIpv: false, mfaResetPath: PATH_NAMES.CHECK_YOUR_EMAIL_CHANGE_SECURITY_CODES + "?type=AUTH_APP", @@ -88,6 +89,7 @@ describe("enter authenticator app code controller", () => { "enter-authenticator-app-code/index.njk", { isAccountRecoveryPermitted: false, + supportMfaResetWithIpv: false, mfaResetPath: PATH_NAMES.CHECK_YOUR_EMAIL_CHANGE_SECURITY_CODES + "?type=AUTH_APP", @@ -123,6 +125,7 @@ describe("enter authenticator app code controller", () => { UPLIFT_REQUIRED_AUTH_APP_TEMPLATE_NAME, { isAccountRecoveryPermitted: true, + supportMfaResetWithIpv: false, mfaResetPath: PATH_NAMES.CHECK_YOUR_EMAIL_CHANGE_SECURITY_CODES + "?type=AUTH_APP", @@ -142,6 +145,7 @@ describe("enter authenticator app code controller", () => { ENTER_AUTH_APP_CODE_DEFAULT_TEMPLATE_NAME, { isAccountRecoveryPermitted: true, + supportMfaResetWithIpv: false, mfaResetPath: PATH_NAMES.CHECK_YOUR_EMAIL_CHANGE_SECURITY_CODES + "?type=AUTH_APP", @@ -161,6 +165,7 @@ describe("enter authenticator app code controller", () => { "enter-authenticator-app-code/index.njk", { isAccountRecoveryPermitted: true, + supportMfaResetWithIpv: true, mfaResetPath: PATH_NAMES.MFA_RESET_WITH_IPV, } ); diff --git a/src/locales/cy/translation.json b/src/locales/cy/translation.json index fd829772c..4efa83023 100644 --- a/src/locales/cy/translation.json +++ b/src/locales/cy/translation.json @@ -2505,6 +2505,8 @@ "summary": "Nid oes gennyf fynediad i’r ap dilysydd", "text1": "Gallwch newid sut ", "text2": "gallwch gael codau diogelwch yn ddiogel", + "text1MfaResetWithIpv": "Os nad oes gennych fynediad i’ch ap dilysu mwyach, ", + "text2MfaResetWithIpv": "gwiriwch a allwch newid sut rydych yn cael codau diogelwch", "text3": "." }, "upliftRequired": { diff --git a/src/locales/en/translation.json b/src/locales/en/translation.json index 3baf7d254..33651d926 100644 --- a/src/locales/en/translation.json +++ b/src/locales/en/translation.json @@ -2505,6 +2505,8 @@ "summary": "I do not have access to the authenticator app", "text1": "You can securely ", "text2": "change how you get security codes", + "text1MfaResetWithIpv": "If you no longer have access to your authenticator app, ", + "text2MfaResetWithIpv": "check if you can change how you get security codes", "text3": "." }, "upliftRequired": {