Phase 1 reliability/stabilisation: auth logging, logout client, loader+xml hardening
This commit is contained in:
+3
-10
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user