updatd logout links and login flow for nextauth

This commit is contained in:
2022-04-19 12:25:13 +01:00
parent 511a5ed98d
commit 3b1a49e561
9 changed files with 81 additions and 45 deletions
+8 -1
View File
@@ -7,6 +7,9 @@ import { useDispatch, useSelector, shallowEqual, connect } from "react-redux";
import { setLogout } from "../store/accountDetails/action";
import _ from "lodash";
import { parseCookies, setCookie, destroyCookie } from "nookies";
import { useSession, signIn, signOut } from "next-auth/react";
const Header = (props) => {
let { t, lang } = useTranslation();
@@ -33,6 +36,9 @@ const Header = (props) => {
"/myportal/error",
"/accessibility",
"/details-about-cookies",
"/auth/verify-request",
"/auth/signin",
"/auth/error",
];
const hasContactLink = [
"/dns/application-process",
@@ -214,7 +220,8 @@ const Header = (props) => {
<a
onClick={() => {
destroyCookie({}, "pinsUser"),
window.localStorage.clear();
window.localStorage.clear(),
signOut({ callbackUrl: "/logout" });
}}
className="govuk-header__link govuk-!-margin-right-3"
>