From de8319db545db06598c3a99d5043789497eae04b Mon Sep 17 00:00:00 2001
From: rdbsolutions
- { - // 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" }); - // }} - > + {t("account:register-new-account-my-portal-link")}
diff --git a/components/header.js b/components/header.js index 3750da5e..fedc8d72 100644 --- a/components/header.js +++ b/components/header.js @@ -74,10 +74,10 @@ const Header = (props) => { 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"), + 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: "/logout" }); }; diff --git a/components/myportal.js b/components/myportal.js index 40b8269f..65629f5c 100644 --- a/components/myportal.js +++ b/components/myportal.js @@ -25,10 +25,10 @@ const MyPortal = (props) => { 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"), + 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: "/logout" }); }; diff --git a/components/timeout/index.js b/components/timeout/index.js index 8a3a2463..05475c36 100644 --- a/components/timeout/index.js +++ b/components/timeout/index.js @@ -41,10 +41,10 @@ const TimeOut = (props) => { 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"), + 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: "/logout" }); }; diff --git a/pages/_error.js b/pages/_error.js index 8152de70..37d84e95 100644 --- a/pages/_error.js +++ b/pages/_error.js @@ -41,14 +41,20 @@ function Error({ statusCode }, props) { window.localStorage.clear(), destroyCookie( null, - "next-auth.csrf-token" + "next-auth.csrf-token", + { path: "/" } ), destroyCookie( null, - "next-auth.callback-url" + "next-auth.callback-url", + { path: "/" } ), - destroyCookie(null, "pedw_locale"), - destroyCookie(null, "pinsUser"), + destroyCookie(null, "pedw_locale", { + path: "/", + }), + destroyCookie(null, "pinsUser", { + path: "/", + }), session != null ? signOut({ callbackUrl: "/", diff --git a/pages/error.js b/pages/error.js index affcf3ac..c1de6a39 100644 --- a/pages/error.js +++ b/pages/error.js @@ -42,16 +42,23 @@ function Error({ statusCode }, props) { className="govuk-link" onClick={() => { window.localStorage.clear(), + window.localStorage.clear(), destroyCookie( null, - "next-auth.csrf-token" + "next-auth.csrf-token", + { path: "/" } ), destroyCookie( null, - "next-auth.callback-url" + "next-auth.callback-url", + { path: "/" } ), - destroyCookie(null, "pedw_locale"), - destroyCookie(null, "pinsUser"), + destroyCookie(null, "pedw_locale", { + path: "/", + }), + destroyCookie(null, "pinsUser", { + path: "/", + }), session != null ? signOut({ callbackUrl: "/", diff --git a/pages/furtherdetails.js b/pages/furtherdetails.js index ce4669d1..28a33e3c 100644 --- a/pages/furtherdetails.js +++ b/pages/furtherdetails.js @@ -15,10 +15,10 @@ const FourOhFour = (props) => { 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"), + 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: "/" }); };