set case to watch on auth
This commit is contained in:
+11
-17
@@ -56,6 +56,16 @@ const Header = (props) => {
|
||||
domainSwitch = process.env.I18N_DOMAIN;
|
||||
}
|
||||
|
||||
const handleLogout = () => {
|
||||
console.info("////////////\n" + "logout" + "\n////////////");
|
||||
window.localStorage.clear(),
|
||||
destroyCookie(null, "next-auth.csrf-token"),
|
||||
destroyCookie(null, "next-auth.callback-url"),
|
||||
destroyCookie(null, "pedw_locale"),
|
||||
destroyCookie(null, "pinsUser"),
|
||||
signOut({ callbackUrl: "/logout" });
|
||||
};
|
||||
|
||||
return (
|
||||
<header
|
||||
className="govuk-header "
|
||||
@@ -219,23 +229,7 @@ const Header = (props) => {
|
||||
>
|
||||
<a
|
||||
onClick={() => {
|
||||
window.localStorage.clear(),
|
||||
destroyCookie(
|
||||
null,
|
||||
"next-auth.csrf-token"
|
||||
),
|
||||
destroyCookie(
|
||||
null,
|
||||
"next-auth.callback-url"
|
||||
),
|
||||
destroyCookie(null, "pedw_locale"),
|
||||
destroyCookie(null, "pinsUser"),
|
||||
signOut({
|
||||
callbackUrl:
|
||||
locale == "cy"
|
||||
? "/allgofnodi"
|
||||
: "/logout",
|
||||
});
|
||||
handleLogout();
|
||||
}}
|
||||
className="govuk-header__link govuk-!-margin-right-3"
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user