updatd logout links and login flow for nextauth
This commit is contained in:
@@ -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"
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user