set case to watch on auth

This commit is contained in:
2023-10-26 07:38:10 +01:00
parent f3da69dc75
commit 1807749bba
4 changed files with 77 additions and 39 deletions
+11 -17
View File
@@ -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"
>