updated error home link and copy on error page

This commit is contained in:
2022-11-07 13:30:09 +00:00
parent 6197646b0f
commit 0d5adbc899
10 changed files with 62 additions and 44 deletions
+11 -6
View File
@@ -6,6 +6,7 @@ import Footer from "../components/footer";
import Header from "../components/header";
import { parseCookies, setCookie, destroyCookie } from "nookies";
import { useSession, signIn, signOut } from "next-auth/react";
import Router from "next/router";
function Error({ statusCode }, props) {
let { t, lang } = useTranslation();
@@ -34,16 +35,20 @@ function Error({ statusCode }, props) {
: `An error occured`}
</p>
<p className="govuk-body">
{t("common:error-instruction-label")}
</p>
<a
href={session != null ? "#" : "/"}
className="govuk-link"
onClick={() => {
destroyCookie({}, "pinsUser"),
window.localStorage.clear(),
session != null &&
signOut({
callbackUrl: "/",
});
window.localStorage.clear(),
destroyCookie({}, "pinsUser"),
session != null
? signOut({
callbackUrl: "/",
})
: Router.push("/");
}}
>
Go back home