updated error home link and copy on error page
This commit is contained in:
+11
-6
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user