diff --git a/.nvmrc b/.nvmrc index b6a7d89c68..3c032078a4 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -16 +18 diff --git a/middleware/middleware.js b/middleware/middleware.js index 817e1278e4..f00ea57678 100644 --- a/middleware/middleware.js +++ b/middleware/middleware.js @@ -1,4 +1,34 @@ +/* eslint-disable sonarjs/cognitive-complexity */ // nuxt i18n is not handling our rootRedirect with a prefix - so we force a redirect here export default function (ctx) { - if (ctx.route.fullPath === "/es" || ctx.route.fullPath === "/es/") ctx.redirect(301, "/es/death-of-a-loved-one") + // https://benefits-tool.usa.gov https://usa.gov/benefit-finder + if (ctx.route.fullPath === "/" || ctx.route.fullPath === "") ctx.redirect(301, "https://www.usa.gov/benefit-finder") + + // https://benefits-tool.usa.gov/es https://usa.gov/es/buscador-beneficios + if (ctx.route.fullPath === "/es" || ctx.route.fullPath === "/es/") + ctx.redirect(301, "https://www.usa.gov/es/buscador-beneficios") + + // https://benefits-tool.usa.gov/death-of-a-loved-one https://usa.gov/benefit-finder/death + if (ctx.route.fullPath === "/death-of-a-loved-one" || ctx.route.fullPath === "/death-of-a-loved-one/") + ctx.redirect(301, "https://www.usa.gov/benefit-finder/death") + + // https://benefits-tool.usa.gov/es/death-of-a-loved-one https://usa.gov/es/buscador-beneficios/muerte + if (ctx.route.fullPath === "/es/death-of-a-loved-one" || ctx.route.fullPath === "/es/death-of-a-loved-one/") + ctx.redirect(301, "https://www.usa.gov/es/buscador-beneficios/muerte") + + // https://benefits-tool.usa.gov/disability https://usa.gov/benefit-finder/disability + if (ctx.route.fullPath === "/disability" || ctx.route.fullPath === "/disability/") + ctx.redirect(301, "https://usa.gov/benefit-finder/disability") + + // https://benefits-tool.usa.gov/es/disability https://usa.gov/es/buscador-beneficios/discapacidad + if (ctx.route.fullPath === "/es/disability" || ctx.route.fullPath === "/es/disability/") + ctx.redirect(301, "https://usa.gov/es/buscador-beneficios/discapacidad") + + // https://benefits-tool.usa.gov/retirement https://usa.gov/benefit-finder/retirement + if (ctx.route.fullPath === "/retirement" || ctx.route.fullPath === "/retirement/") + ctx.redirect(301, "https://usa.gov/benefit-finder/retirement") + + // https://benefits-tool.usa.gov/es/retirement https://usa.gov/es/buscador-beneficios/jubilacion + if (ctx.route.fullPath === "/es/retirement" || ctx.route.fullPath === "/es/retirement/") + ctx.redirect(301, "https://usa.gov/es/buscador-beneficios/jubilacion") } diff --git a/nuxt.config.js b/nuxt.config.js index aa0ad33084..48feb14cd1 100644 --- a/nuxt.config.js +++ b/nuxt.config.js @@ -100,9 +100,6 @@ export default { lazy: true, langDir: "locales", defaultLocale: "en", - rootRedirect: { - path: "death-of-a-loved-one", - }, }, // Axios module configuration: https://go.nuxtjs.dev/config-axios diff --git a/package.json b/package.json index cf27aeb70f..12f02bfc02 100644 --- a/package.json +++ b/package.json @@ -5,10 +5,10 @@ "license": "See license in CONTRIBUTING.md", "repository": "https://github.com/GSA/usagov-benefits-eligibility", "scripts": { - "dev": "gulp && nuxt", - "build": "gulp && nuxt build", - "start": "gulp && nuxt start", - "generate": "gulp && nuxt generate", + "dev": "export NODE_OPTIONS=--openssl-legacy-provider gulp && nuxt", + "build": "export NODE_OPTIONS=--openssl-legacy-provider gulp && nuxt build", + "start": "export NODE_OPTIONS=--openssl-legacy-provider gulp && nuxt start", + "generate": "export NODE_OPTIONS=--openssl-legacy-provider gulp && nuxt generate", "lint:js": "eslint --ext \".js,.vue\" --ignore-path .gitignore .", "sonarqube": "npm test && ./sonar_scanner_cli.bash", "lint": "npm run lint:js", diff --git a/pages/_lifeEvent.vue b/pages/_lifeEvent.vue index e235417987..e1fd9429cc 100644 --- a/pages/_lifeEvent.vue +++ b/pages/_lifeEvent.vue @@ -8,11 +8,11 @@ class="font-heading-lg tablet:font-heading-xl tablet:margin-top-4 text-secondary print:text-black"> {{ lifeEvent.secondaryHeadline }} - +

{{$t("beta.subheader")}}

- +

@@ -215,6 +215,7 @@ import { tObj, tCsv } from "~/services/translation" export default { name: "LifeEvent", layout: "default", + middleware: ['middleware'], async asyncData({ $content }) { const landingPage = await $content("landing-page").fetch() return { landingPage }