diff --git a/components/breadcrumbs.js b/components/breadcrumbs.js index bc892385..c7f681a5 100644 --- a/components/breadcrumbs.js +++ b/components/breadcrumbs.js @@ -744,7 +744,7 @@ const Breadcrumbs = (props) => { {router.pathname == "/auth/signin" ? ( <>
  • - Sign in + {t("auth:auth-page-title")}
  • ) : ( @@ -753,7 +753,16 @@ const Breadcrumbs = (props) => { {router.pathname == "/auth/verify-request" ? ( <>
  • - Check your email + {t("auth:auth-check-email-page-title")} +
  • + + ) : ( + "" + )} + {router.pathname == "/auth/error" ? ( + <> +
  • + {t("auth:auth-error-signin-error-title")}
  • ) : ( diff --git a/components/homepage/login.js b/components/homepage/login.js index c47d0b0f..99e53b97 100644 --- a/components/homepage/login.js +++ b/components/homepage/login.js @@ -189,28 +189,6 @@ let Login = (props) => { : ""; }, [cookies.pinsUser, router]); - const govGatwayLoginRedirect = () => { - let ggUrl = - props.govGateway.config.authorization_endpoint + - "?response_type=code&scope=openid&client_id=" + - GG_CLIENT_ID + - "&redirect_uri=" + - GG_REDIRECT_URI + - "&ui_locales=" + - (router.locale == "cy" ? "cy" : "en-GB"); - - console.log("login Url:", ggUrl); - - router.replace(ggUrl); - }; - - const govGatwayForgottenLink = () => { - let ggUrl = - props.govGateway.config.authorization_endpoint + - "/login/forgot-password"; - router.replace(ggUrl); - }; - if (session === "loading") { return

    loading...

    ; } @@ -229,7 +207,8 @@ let Login = (props) => {

    - {t("home:login-card-title")} + {/* {t("home:login-card-title")} */} + {t("home:login-card-title-temp")}

    {" "}
    @@ -240,9 +219,13 @@ let Login = (props) => { )} {session && ( @@ -255,7 +238,13 @@ let Login = (props) => { )}
    -
    +

    + {t("home:login-comingsoon-temp-1")}{" "} +

    +

    + {t("home:login-comingsoon-temp-1a")}{" "} +

    + {/* {validLoginID == false && (
    Incorrect username or password @@ -281,14 +270,6 @@ let Login = (props) => { /> { {t("home:login-card-button")}
    -
    - {/*
    -

    + */} +

    + {/*

    { govGatwayLoginRedirect(); @@ -327,7 +308,8 @@ let Login = (props) => { {t("home:login-card-register-link")}

    -

    + */} + {/*

    { govGatwayForgottenLink(); @@ -336,7 +318,7 @@ let Login = (props) => { > {t("home:login-card-forgotten-label")}{" "} -

    +

    */}

    {t("home:login-comingsoon-temp-2")} @@ -405,7 +387,7 @@ let Login = (props) => { {t("home:login-contact-email")}

    -
    */} +
    {/* {
    - - - - + {showLogin == "true" && ( { session={session} /> )} + {showLogin != "true" && } + {/* */}
    diff --git a/i18n.js b/i18n.js index 864fa98b..d90f7d71 100644 --- a/i18n.js +++ b/i18n.js @@ -48,5 +48,8 @@ module.exports = { "/details-about-cookies": ["common", "cookies"], "/terms-and-conditions": ["common"], "/account/passwordreset": ["common", "home"], + "/auth/signin": ["common", "common", "auth"], + "/auth/verify-request": ["common", "common", "auth"], + "/auth/error": ["common", "common", "auth"], }, }; diff --git a/locales/cy/auth.json b/locales/cy/auth.json new file mode 100644 index 00000000..7c14ab0a --- /dev/null +++ b/locales/cy/auth.json @@ -0,0 +1,21 @@ +{ + "auth-page-title": "Mewngofnodi", + "auth-email-label": "Cyfeiriad ebost", + "auth-signin-button-label": "Mewngofnodwch gyda'ch e-bost", + "auth-check-email-page-title": "Gwiriwch eich e-bost", + "auth-check-email-message": "Mae dolen wedi'i hanfon i'ch e-bost er mwyn i chi allu parhau. Caewch y ffenestr hon.", + "auth-return-home-link-label": "Dychwelyd i Gartref", + "auth-error-signin-error-title": "Gwall Mewngofnodi", + "auth-error-heading": "Mae gwall wedi bod", + "auth-error-Signin-label": "Ceisiwch arwyddo gyda chyfrif gwahanol.", + "auth-error-OAuthSignin-label": "Ceisiwch arwyddo gyda chyfrif gwahanol.", + "auth-error-OAuthCallback-label": "Ceisiwch arwyddo gyda chyfrif gwahanol.", + "auth-error- OAuthCreateAccount-label": "Ceisiwch arwyddo gyda chyfrif gwahanol.", + "auth-error-EmailCreateAccount-label": "Ceisiwch arwyddo gyda chyfrif gwahanol.", + "auth-error-Callback-label": "Ceisiwch arwyddo gyda chyfrif gwahanol.", + "auth-error-OAuthAccountNotLinked-label": "I gadarnhau pwy ydych, mewngofnodwch gyda'r un cyfrif a ddefnyddiwyd gennych yn wreiddiol.", + "auth-error-EmailSignin-label": "Gwiriwch eich cyfeiriad e-bost.", + "auth-error-CredentialsSignin-label": "Methodd mewngofnodi. Gwiriwch fod y manylion a ddarparwyd gennych yn gywir.", + "auth-error-Verification-label": "Methu mewngofnodi. Nid yw'r ddolen mewngofnodi yn ddilys bellach. Efallai ei fod wedi cael ei ddefnyddio eisoes neu efallai ei fod wedi dod i ben.", + "auth-error-default-label": "Methu mewngofnodi." +} \ No newline at end of file diff --git a/locales/cy/home.json b/locales/cy/home.json index 4bef2d41..f48950f8 100644 --- a/locales/cy/home.json +++ b/locales/cy/home.json @@ -1,6 +1,7 @@ { "login-card-title-temp": "Apeliadau neu geisiadau newydd", "login-comingsoon-temp-1": "Mae'r gwasanaeth hwn yn cael ei ddatblygu i gefnogi apeliadau a cheisiadau ar-lein.", + "login-comingsoon-temp-1a": "Ar hyn o bryd gallwch godi Apeliadau Cynllunio a78, Caniatâd Adeilad Rhestredig ac Ardal Gadwraeth, Apeliadau Deiliaid Tai a Mân Apeliadau Masnachol - HAS/CAS, Hysbysebion ac apeliadau Dilysu.", "login-comingsoon-temp-2": "Wrth i ni ddatblygu’r gwasanaeth ar-lein, dewch o hyd i:", "login-comingsoon-forms-link-1": "https://llyw.cymru/ffurflenni-apelio", "login-comingsoon-forms-label-1": "ffurflenni apêl cynllunio a ffurflenni cais cynllunio", @@ -22,6 +23,7 @@ "login-card-forgotten-label": "Rwyf wedi anghofio fy nghyfrinair", "login-card-forgotten-link": "Cliciwch yma", "login-via-gov-gateway-label": "Mewngofnodi trwy Borth y Llywodraeth", + "login-via-nextuth-label": "Mewngofnodwch gyda'ch cyfeiriad e-bost", "casesearch-card-title": "Chwilio apeliadau a Datblygiadau o Arwyddocâd Cenedlaethol", "casesearch-card-search-hint": "Defnyddiwch gyfeimod yr achos neu deitl DAC i chwilio. Bydd cyfeirnod yr achos yn debyg i un o'r canlynol:", "casesearch-card-search-example-label-1": "APP-A12345-A-21-1234567", diff --git a/locales/en/auth.json b/locales/en/auth.json new file mode 100644 index 00000000..1d3ac756 --- /dev/null +++ b/locales/en/auth.json @@ -0,0 +1,21 @@ +{ + "auth-page-title": "Sign in", + "auth-email-label": "Email address", + "auth-signin-button-label": "Sign in with your email", + "auth-check-email-page-title": "Check your email", + "auth-check-email-message": "A link has been sent to your email so you can continue. Please close this window.", + "auth-return-home-link-label": "Return to Home", + "auth-error-signin-error-title": "Sign in Error", + "auth-error-heading": "There has been an error", + "auth-error-Signin-label": "Try signing with a different account.", + "auth-error-OAuthSignin-label": "Try signing with a different account.", + "auth-error-OAuthCallback-label": "Try signing with a different account.", + "auth-error- OAuthCreateAccount-label": "Try signing with a different account.", + "auth-error-EmailCreateAccount-label": "Try signing with a different account.", + "auth-error-Callback-label": "Try signing with a different account.", + "auth-error-OAuthAccountNotLinked-label": "To confirm your identity, sign in with the same account you used originally.", + "auth-error-EmailSignin-label": "Check your email address.", + "auth-error-CredentialsSignin-label": "Sign in failed. Check the details you provided are correct.", + "auth-error-Verification-label": "Unable to sign in. The sign in link is no longer valid.It may have been used already or it may have expired. ", + "auth-error-default-label": "Unable to sign in." +} \ No newline at end of file diff --git a/locales/en/home.json b/locales/en/home.json index 66d34415..6d66e076 100644 --- a/locales/en/home.json +++ b/locales/en/home.json @@ -1,6 +1,7 @@ { "login-card-title-temp": "New appeals or applications", "login-comingsoon-temp-1": "This service is being developed to support online appeals and applications.", + "login-comingsoon-temp-1a": "You can currently raise Planning Appeals s78, Listed Building and Conservation Area Consent, Householder and Minor Commercial Appeals - HAS/CAS, Adverts and Non-Validation appeals.", "login-comingsoon-temp-2": "While we develop the online service, find:", "login-comingsoon-forms-link-1": "https://gov.wales/planning-appeal-forms", "login-comingsoon-forms-label-1": "planning appeal and application forms", @@ -22,6 +23,7 @@ "login-card-forgotten-label": "I have forgotten my password", "login-card-forgotten-link": "Click here", "login-via-gov-gateway-label": "Log in via Government Gateway", + "login-via-nextuth-label": "Sign in with your email address", "casesearch-card-title": "Search appeals and Developments of National Significance", "casesearch-card-search-hint": "Use the case reference or DNS title to search. Case reference will be similar to one of the following:", "casesearch-card-search-example-label-1": "APP-A12345-A-21-1234567", diff --git a/package.json b/package.json index 586bc6a8..cc2f6be4 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,8 @@ "dev": "next dev", "dev:app": "node ./server/server.js", "build": "NODE_ENV=production node_modules/next/dist/bin/next build", - "start": "node_modules/next/dist/bin/next start" + "start": "node_modules/next/dist/bin/next start", + "lint": "next lint" }, "dependencies": { "@azure/identity": "^2.0.5", @@ -86,4 +87,4 @@ "prettier": "2.5.1", "prisma": "^3.12.0" } -} +} \ No newline at end of file diff --git a/pages/auth/error.js b/pages/auth/error.js index 2d0113b0..b8142769 100644 --- a/pages/auth/error.js +++ b/pages/auth/error.js @@ -16,20 +16,17 @@ const Error = (props) => { const { error } = useRouter().query; const errors = { - Signin: "Try signing with a different account.", - OAuthSignin: "Try signing with a different account.", - OAuthCallback: "Try signing with a different account.", - OAuthCreateAccount: "Try signing with a different account.", - EmailCreateAccount: "Try signing with a different account.", - Callback: "Try signing with a different account.", - OAuthAccountNotLinked: - "To confirm your identity, sign in with the same account you used originally.", - EmailSignin: "Check your email address.", - CredentialsSignin: - "Sign in failed. Check the details you provided are correct.", - Verification: - "Unable to sign in. The sign in link is no longer valid.It may have been used already or it may have expired. ", - default: "Unable to sign in.", + Signin: t("auth:auth-error-Signin-label"), + OAuthSignin: t("auth:auth-error-OAuthSignin-label"), + OAuthCallback: t("auth:auth-error-OAuthCallback-label"), + OAuthCreateAccount: t("auth:auth-error-OAuthCreateAccount-label"), + EmailCreateAccount: t("auth:auth-error-EmailCreateAccount-label"), + Callback: t("auth:auth-error-Callback-label"), + OAuthAccountNotLinked: t("auth:auth-error-OAuthAccountNotLinked-label"), + EmailSignin: t("auth:auth-error-EmailSignin-label"), + CredentialsSignin: t("auth:auth-error-CredentialsSignin-label"), + Verification: t("auth:auth-error-Verification-label"), + default: t("auth:auth-error-default-label"), }; const errorMessage = error && (errors[error] ?? errors.default); @@ -37,7 +34,10 @@ const Error = (props) => { return (
    - Sign in Error - {t("common:service-name")} + + {t("auth:auth-error-signin-error-title")} -{" "} + {t("common:service-name")} +
    @@ -48,7 +48,7 @@ const Error = (props) => {
    -

    There has been an error

    +

    {t("auth:auth-error-heading")}

    @@ -58,8 +58,9 @@ const Error = (props) => {
    - {" "} - Return to Home + + {t("auth:auth-return-home-link-label")} +
    diff --git a/pages/auth/signin.js b/pages/auth/signin.js index e389cf3b..be7db3da 100644 --- a/pages/auth/signin.js +++ b/pages/auth/signin.js @@ -14,7 +14,9 @@ const SignIn = (props) => { return (
    - Sign in - {t("common:service-name")} + + {t("auth:auth-page-title")} - {t("common:service-name")} +
    @@ -24,7 +26,7 @@ const SignIn = (props) => {
    -

    Sign in

    +

    {t("auth:auth-page-title")}

    @@ -44,7 +46,7 @@ const SignIn = (props) => { className="govuk-label" htmlFor="email" > - Email address{" "} + {t("auth:auth-email-label")} { type="submit" className="govuk-button" > - Sign in with your email + {t("auth:auth-signin-button-label")}
    diff --git a/pages/auth/verify-request.js b/pages/auth/verify-request.js index 54dcac67..232347b3 100644 --- a/pages/auth/verify-request.js +++ b/pages/auth/verify-request.js @@ -15,7 +15,10 @@ const SignIn = (props) => { return (
    - Sign in - {t("common:service-name")} + + {t("auth:auth-check-email-page-title")} -{" "} + {t("common:service-name")} +
    @@ -26,19 +29,20 @@ const SignIn = (props) => {
    -

    Check your email

    +

    {t("auth:auth-check-email-page-title")}

    - A link has been sent to your email so you can - continue. Please close this window. + {t("auth:auth-check-email-message")}
    {" "} - Return to Home + + {t("auth:auth-return-home-link-label")} +