Merged PR 2315: Auth stabilistatiion and hardening

Related work items: #23020
This commit is contained in:
Robert Bond
2026-05-14 08:55:49 +00:00
parent d295a507ac
commit d0b2fd077a
41 changed files with 1462 additions and 418 deletions
+3 -13
View File
@@ -1,8 +1,7 @@
import useTranslation from "next-translate/useTranslation";
import router from "next/router";
import Link from "next/link";
import { destroyCookie } from "nookies";
import { signOut } from "next-auth/react";
import { performPortalSignOut } from "../../lib/auth/sessionClient";
const ServiceBanner = (props) => {
props = props.props;
@@ -19,23 +18,14 @@ const ServiceBanner = (props) => {
};
const handleLogout = (locale) => {
console.info("////////////\n" + "logout" + "\n////////////");
window.localStorage.clear(),
destroyCookie(null, "next-auth.csrf-token"),
{ path: "/" },
destroyCookie(null, "next-auth.callback-url", { path: "/" }),
destroyCookie(null, "pedw_locale", { path: "/" }),
destroyCookie(null, "pinsUser", { path: "/" }),
signOut({
callbackUrl: locale == "cy" ? "/cy/allgofnodi" : "/logout",
});
performPortalSignOut(locale);
};
const portalLogoLink = [
"/myportal/[appealtypes]",
"/newappeal",
"/newappeal/[appealtypes]",
"/myportal/representation",
"/myportal/representation"
];
return (
<div className="servicebanner myportal govuk-!-margin-bottom-4">