diff --git a/ci/terraform/build.tfvars b/ci/terraform/build.tfvars index 55cbd3d20..12779a4c0 100644 --- a/ci/terraform/build.tfvars +++ b/ci/terraform/build.tfvars @@ -29,3 +29,4 @@ orch_to_auth_audience = "https://signin.build.account.gov.uk/" dynatrace_secret_arn = "arn:aws:secretsmanager:eu-west-2:216552277552:secret:DynatraceNonProductionVariables" frame_ancestors_form_actions_csp_headers = "1" +support_2fa_b4_password_reset = "1" diff --git a/src/components/reset-password-2fa-auth-app/index.njk b/src/components/reset-password-2fa-auth-app/index.njk index fe02c3648..707f016bc 100644 --- a/src/components/reset-password-2fa-auth-app/index.njk +++ b/src/components/reset-password-2fa-auth-app/index.njk @@ -1,9 +1,10 @@ {% extends "common/layout/base.njk" %} {% from "govuk/components/input/macro.njk" import govukInput %} +{% from "govuk/components/inset-text/macro.njk" import govukInsetText %} {% from "govuk/components/button/macro.njk" import govukButton %} {% from "govuk/components/details/macro.njk" import govukDetails %} {% from "govuk/components/error-summary/macro.njk" import govukErrorSummary %} -{% set pageTitleName = 'pages.enterAuthenticatorAppCode.title' | translate %} +{% set pageTitleName = 'pages.enterAuthenticatorAppCode.2FaBeforeResetPassword.title' | translate %} {% block content %} @@ -15,12 +16,20 @@ +

{{'pages.enterAuthenticatorAppCode.2FaBeforeResetPassword.header' | translate }}

+ +

+ {{ govukInsetText({ + html: 'pages.enterAuthenticatorAppCode.2FaBeforeResetPassword.info.paragraph1' | translate + + '' + 'pages.enterAuthenticatorAppCode.2FaBeforeResetPassword.info.authenticatorApp' | translate + '' + + 'pages.enterAuthenticatorAppCode.2FaBeforeResetPassword.info.paragraph1End'| translate + }) }} +

+ {{ govukInput({ - label: { - text: 'pages.enterAuthenticatorAppCode.header' | translate, - classes: "govuk-label--l", - isPageHeading: true - }, + label: { + text: 'pages.enterAuthenticatorAppCode.2FaBeforeResetPassword.code.label' | translate + }, classes: "govuk-input--width-10", id: "code", name: "code", @@ -32,6 +41,7 @@ } if (errors['code'])}) }} + {{ govukButton({ "text": "general.continue.label" | translate, "type": "Submit", diff --git a/src/components/reset-password-2fa-auth-app/tests/reset-password-2fa-auth-app-integration.test.ts b/src/components/reset-password-2fa-auth-app/tests/reset-password-2fa-auth-app-integration.test.ts index 6a06c01d8..5fe07910b 100644 --- a/src/components/reset-password-2fa-auth-app/tests/reset-password-2fa-auth-app-integration.test.ts +++ b/src/components/reset-password-2fa-auth-app/tests/reset-password-2fa-auth-app-integration.test.ts @@ -1,6 +1,6 @@ import request from "supertest"; import { describe } from "mocha"; -import { sinon } from "../../../../test/utils/test-utils"; +import { expect, sinon } from "../../../../test/utils/test-utils"; import * as cheerio from "cheerio"; import { API_ENDPOINTS, @@ -61,9 +61,15 @@ describe("Integration::2fa auth app (in reset password flow)", () => { app = undefined; }); - it("should return check auth app page", (done) => { + it("should return updated check auth app page", (done) => { nock(baseApi).persist().post("/mfa").reply(204); - request(app).get(PATH_NAMES.RESET_PASSWORD_2FA_AUTH_APP).expect(200, done); + request(app) + .get(PATH_NAMES.RESET_PASSWORD_2FA_AUTH_APP) + .expect(function (res) { + const $ = cheerio.load(res.text); + expect($("#updatedHeading").length).to.eq(1); + }) + .expect(200, done); }); it("should redirect to reset password step when valid sms code is entered", (done) => { diff --git a/src/locales/cy/translation.json b/src/locales/cy/translation.json index 24966ad7b..cd28836a1 100644 --- a/src/locales/cy/translation.json +++ b/src/locales/cy/translation.json @@ -2204,6 +2204,18 @@ "label": "Rhowch y cod diogelwch", "labelSummary": "Dyma’r rhif 6-digid a ddangosir yn eich ap dilysydd" } + }, + "2FaBeforeResetPassword": { + "title": "Enter a security code from your authenticator app", + "header": "Enter a security code from your authenticator app", + "info": { + "paragraph1": "I gael cod diogelwch, agorwch yr ", + "authenticatorApp": "ap dilysydd ", + "paragraph1End": "rydych wedi’i ddefnyddio i greu eich GOV.UK One Login" + }, + "code":{ + "label": "Rhowch y cod diogelwch 6 digid" + } } }, "securityCodeEnteredExceeded": { diff --git a/src/locales/en/translation.json b/src/locales/en/translation.json index 90b592cff..3e2a8238c 100644 --- a/src/locales/en/translation.json +++ b/src/locales/en/translation.json @@ -2204,6 +2204,18 @@ "label": "Enter the security code", "labelSummary": "This is the 6-digit number shown in your authenticator app" } + }, + "2FaBeforeResetPassword": { + "title": "Enter a security code from your authenticator app", + "header": "Enter a security code from your authenticator app", + "info": { + "paragraph1": "To get a security code, open the ", + "authenticatorApp": "authenticator app ", + "paragraph1End": "you used to create your GOV.UK One Login" + }, + "code":{ + "label": "Enter the 6 digit security code" + } } }, "securityCodeEnteredExceeded": {