Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AUT-3921: Change content for mfa reset with IPV #2444

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ export function enterAuthenticatorAppCodeGet(

return res.render(templateName, {
isAccountRecoveryPermitted: isAccountRecoveryPermittedForUser,
supportMfaResetWithIpv: supportMfaResetWithIpv(),
mfaResetPath,
});
};
Expand Down
8 changes: 8 additions & 0 deletions src/components/enter-authenticator-app-code/index.njk
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<input type="hidden" name="_csrf" value="{{csrfToken}}"/>
<input type="hidden" name="isAccountRecoveryPermitted" value="{{isAccountRecoveryPermitted}}"/>
<input type="hidden" name="mfaResetPath" value="{{mfaResetPath}}"/>
<input type="hidden" name="supportMfaResetWithIpv" value="{{supportMfaResetWithIpv}}"/>

{{ govukInput({
label: {
Expand Down Expand Up @@ -42,10 +43,17 @@

{% if isAccountRecoveryPermitted === true or isAccountRecoveryPermitted === "true" %}
{% set detailsHTML %}
{% if supportMfaResetWithIpv === true or supportMfaResetWithIpv === "true" %}
<p class="govuk-body">
{{'pages.enterAuthenticatorAppCode.details.text1MfaResetWithIpv' | translate}}
<a href="{{mfaResetPath}}" class="govuk-link" rel="noreferrer noopener">{{'pages.enterAuthenticatorAppCode.details.text2MfaResetWithIpv'| translate}}</a>{{'pages.enterAuthenticatorAppCode.details.text3' | translate}}
</p>
{% else %}
<p class="govuk-body">
{{'pages.enterAuthenticatorAppCode.details.text1' | translate}}
<a href="{{mfaResetPath}}" class="govuk-link" rel="noreferrer noopener">{{'pages.enterAuthenticatorAppCode.details.text2'| translate}}</a>{{'pages.enterAuthenticatorAppCode.details.text3' | translate}}
</p>
{% endif %}
{% endset %}

{{ govukDetails({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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,
}
);
Expand Down
1 change: 1 addition & 0 deletions src/components/enter-mfa/enter-mfa-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ export function enterMfaGet(
phoneNumber: req.session.user.redactedPhoneNumber,
supportAccountRecovery: req.session.user.isAccountRecoveryPermitted,
mfaResetPath: mfaResetPath,
supportMfaResetWithIpv: supportMfaResetWithIpv(),
});
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,21 @@
{{ 'pages.enterMfa.details.text 2' | translate }}
</p>
{% if supportAccountRecovery === true or supportAccountRecovery === "true" %}
<p class="govuk-body">
{{ 'pages.enterMfa.details.changeGetSecurityCodesText' | translate }}
<a href={{ mfaResetPath }} class="govuk-link"
rel="noreferrer noopener">{{ 'pages.enterMfa.details.changeGetSecurityCodesLinkText'| translate }}</a>.
</p>
{% if supportAccountRecovery === true or supportAccountRecovery === "true" %}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a repeated line

{% if supportMfaResetWithIpv === true or supportMfaResetWithIpv === "true" %}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume you need to add this as a hidden input also - does the wrong thing appear if you refresh the page?

Copy link
Contributor

@BeckaL BeckaL Jan 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just did a quick test and doesn't seem to make a difference, which makes me wonder if we're doing an amount of this cacheing unnecessarily. Worth verifying on your side

<p class="govuk-body">
{{ 'pages.enterMfa.details.changeGetSecurityCodesTextWithIpv' | translate }}
<a href={{ mfaResetPath }} class="govuk-link"
rel="noreferrer noopener">{{ 'pages.enterMfa.details.changeGetSecurityCodesWithIpvLinkText'| translate }}</a>.
</p>
{% else %}
<p class="govuk-body">
{{ 'pages.enterMfa.details.changeGetSecurityCodesText' | translate }}
<a href={{ mfaResetPath }} class="govuk-link"
rel="noreferrer noopener">{{ 'pages.enterMfa.details.changeGetSecurityCodesLinkText'| translate }}</a>.
</p>
{% endif %}
{% endif %}
{% endif %}
{% endset %}

Expand Down
9 changes: 9 additions & 0 deletions src/components/enter-mfa/index.njk
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
<input type="hidden" name="_csrf" value="{{csrfToken}}"/>
<input type="hidden" name="supportAccountRecovery" value="{{supportAccountRecovery}}"/>
<input type="hidden" name="mfaResetPath" value="{{mfaResetPath}}"/>
<input type="hidden" name="supportMfaResetWithIpv" value="{{supportMfaResetWithIpv}}"/>

{{ govukInput({
label: {
Expand All @@ -51,11 +52,19 @@
</p>

{% if supportAccountRecovery === true or supportAccountRecovery === "true" %}
{% if supportMfaResetWithIpv === true or supportMfaResetWithIpv === "true" %}
<p class="govuk-body">
{{ 'pages.enterMfa.details.changeGetSecurityCodesTextWithIpv' | translate }}
<a href={{ mfaResetPath }} class="govuk-link"
rel="noreferrer noopener">{{ 'pages.enterMfa.details.changeGetSecurityCodesWithIpvLinkText'| translate }}</a>.
</p>
{% else %}
<p class="govuk-body">
{{ 'pages.enterMfa.details.changeGetSecurityCodesText' | translate }}
<a href={{ mfaResetPath }} class="govuk-link"
rel="noreferrer noopener">{{ 'pages.enterMfa.details.changeGetSecurityCodesLinkText'| translate }}</a>.
</p>
{% endif %}
{% endif %}
{% endset %}

Expand Down
3 changes: 3 additions & 0 deletions src/components/enter-mfa/tests/enter-mfa-controller.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ describe("enter mfa controller", () => {
supportAccountRecovery: false,
mfaResetPath:
PATH_NAMES.CHECK_YOUR_EMAIL_CHANGE_SECURITY_CODES + "?type=SMS",
supportMfaResetWithIpv: false,
});
});

Expand All @@ -90,6 +91,7 @@ describe("enter mfa controller", () => {
supportAccountRecovery: true,
mfaResetPath:
PATH_NAMES.CHECK_YOUR_EMAIL_CHANGE_SECURITY_CODES + "?type=SMS",
supportMfaResetWithIpv: false,
});
});

Expand Down Expand Up @@ -151,6 +153,7 @@ describe("enter mfa controller", () => {
phoneNumber: TEST_PHONE_NUMBER,
supportAccountRecovery: true,
mfaResetPath: PATH_NAMES.MFA_RESET_WITH_IPV,
supportMfaResetWithIpv: true,
});
});
});
Expand Down
6 changes: 5 additions & 1 deletion src/locales/cy/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,9 @@
"sendCodeLinkHref": "/resend-code",
"text 2": " os nad yw’r cod yn gweithio neu ni wnaethoch ei dderbyn.",
"changeGetSecurityCodesText": "Os na allwch gyrchu’r rhif ffôn ar gyfer eich GOV.UK One Login, gallwch ",
"changeGetSecurityCodesLinkText": "newid yn ddiogel sut rydych yn cael codau diogelwch"
"changeGetSecurityCodesLinkText": "newid yn ddiogel sut rydych yn cael codau diogelwch",
"changeGetSecurityCodesTextWithIpv": "Os nad oes gennych fynediad i’ch ap dilysu mwyach, ",
"changeGetSecurityCodesWithIpvLinkText": "gwiriwch a allwch newid sut rydych yn cael codau diogelwch"
},
"upliftRequired": {
"title": "Rhowch god diogelwch i barhau",
Expand Down Expand Up @@ -2503,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": {
Expand Down
6 changes: 5 additions & 1 deletion src/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,9 @@
"sendCodeLinkHref": "/resend-code",
"text 2": " if the code is not working or you did not receive it.",
"changeGetSecurityCodesText": "If you cannot access the phone number for your GOV.UK One Login, you can securely ",
"changeGetSecurityCodesLinkText": "change how you get security codes"
"changeGetSecurityCodesLinkText": "change how you get security codes",
"changeGetSecurityCodesTextWithIpv": "If you no longer have access to this phone number, ",
"changeGetSecurityCodesWithIpvLinkText": "check if you can change how you get security codes"
},
"upliftRequired": {
"title": "Enter a security code to continue",
Expand Down Expand Up @@ -2503,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": {
Expand Down
Loading