Phase 1 reliability/stabilisation: auth logging, logout client, loader+xml hardening

This commit is contained in:
2026-05-13 10:05:49 +01:00
parent d36a56c4c9
commit 8fe06c09c4
9 changed files with 125 additions and 49 deletions
+3 -10
View File
@@ -2,12 +2,12 @@ import _ from "lodash";
import useTranslation from "next-translate/useTranslation";
import Link from "next/link";
import { useRouter } from "next/router";
import { destroyCookie, setCookie } from "nookies";
import { setCookie } from "nookies";
import { connect } from "react-redux";
import Banner from "../components/banner";
import { setLogout } from "../store/accountDetails/action";
import { signOut } from "next-auth/react";
import { logoutClient } from "../lib/auth/logoutClient";
const Header = (props) => {
let { t, lang } = useTranslation();
@@ -85,14 +85,7 @@ const Header = (props) => {
const handleLogout = () => {
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"
}));
logoutClient(locale);
};
//const switchLocale = locale === "en" ? "cy" : "en";