import useTranslation from "next-translate/useTranslation"; import Head from "next/head"; import Link from "next/link"; import { useRouter } from "next/router"; import Breadcrumbs from "../../components/breadcrumbs"; import CookieBanner from "../../components/cookieBanner"; import Footer from "../../components/footer"; import Header from "../../components/header"; import ServiceBanner from "../../components/servicebanner"; import { useEffect } from "react"; import { getCsrfToken } from "next-auth/react"; import { clearSessionArtifacts } from "../../lib/auth/sessionClient"; const Error = (props) => { let { t, lang } = useTranslation(); const { footerLinks, pages, csrfToken } = props; const { error } = useRouter().query; useEffect(() => { clearSessionArtifacts(); }, []); const errors = { 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); return (