updated authentication for welsh url

This commit is contained in:
2025-04-09 10:24:44 +01:00
parent 0c11bd846b
commit c874bb4f59
9 changed files with 167 additions and 110 deletions
+8 -4
View File
@@ -18,7 +18,7 @@ const ServiceBanner = (props) => {
);
};
const handleLogout = () => {
const handleLogout = (locale) => {
console.info("////////////\n" + "logout" + "\n////////////");
window.localStorage.clear(),
destroyCookie(null, "next-auth.csrf-token"),
@@ -26,7 +26,9 @@ const ServiceBanner = (props) => {
destroyCookie(null, "next-auth.callback-url", { path: "/" }),
destroyCookie(null, "pedw_locale", { path: "/" }),
destroyCookie(null, "pinsUser", { path: "/" }),
signOut({ callbackUrl: "/logout" });
signOut({
callbackUrl: locale == "cy" ? "/cy/allgofnodi" : "/logout",
});
};
const portalLogoLink = [
@@ -87,9 +89,11 @@ const ServiceBanner = (props) => {
</div>
<div>
<Link
href={router.locale == "cy" ? "/allgofnodi" : "/logout"}
href={
router.locale == "cy" ? "/cy/allgofnodi" : "/logout"
}
onClick={() => {
handleLogout();
handleLogout(router.locale);
}}
className="govuk-header__link "
>