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 1 commit
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
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
4 changes: 3 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
4 changes: 3 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