updated authentication for welsh url
This commit is contained in:
@@ -18,7 +18,7 @@ const ServiceBanner = (props) => {
|
||||
);
|
||||
};
|
||||
|
||||
const handleLogout = () => {
|
||||
const handleLogout = (locale) => {
|
||||
console.info("////////////\n" + "logout" + "\n////////////");
|
||||
window.localStorage.clear(),
|
||||
destroyCookie(null, "next-auth.csrf-token"),
|
||||
@@ -26,7 +26,9 @@ const ServiceBanner = (props) => {
|
||||
destroyCookie(null, "next-auth.callback-url", { path: "/" }),
|
||||
destroyCookie(null, "pedw_locale", { path: "/" }),
|
||||
destroyCookie(null, "pinsUser", { path: "/" }),
|
||||
signOut({ callbackUrl: "/logout" });
|
||||
signOut({
|
||||
callbackUrl: locale == "cy" ? "/cy/allgofnodi" : "/logout",
|
||||
});
|
||||
};
|
||||
|
||||
const portalLogoLink = [
|
||||
@@ -87,9 +89,11 @@ const ServiceBanner = (props) => {
|
||||
</div>
|
||||
<div>
|
||||
<Link
|
||||
href={router.locale == "cy" ? "/allgofnodi" : "/logout"}
|
||||
href={
|
||||
router.locale == "cy" ? "/cy/allgofnodi" : "/logout"
|
||||
}
|
||||
onClick={() => {
|
||||
handleLogout();
|
||||
handleLogout(router.locale);
|
||||
}}
|
||||
className="govuk-header__link "
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user