check on link to log out if a session exists
This commit is contained in:
+6
-4
@@ -11,6 +11,8 @@ function Error({ statusCode }, props) {
|
|||||||
let { t, lang } = useTranslation();
|
let { t, lang } = useTranslation();
|
||||||
const { footerLinks, pages } = props;
|
const { footerLinks, pages } = props;
|
||||||
|
|
||||||
|
const { data: session, status } = useSession();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Head>
|
<Head>
|
||||||
@@ -38,12 +40,12 @@ function Error({ statusCode }, props) {
|
|||||||
onClick={() => {
|
onClick={() => {
|
||||||
destroyCookie({}, "pinsUser"),
|
destroyCookie({}, "pinsUser"),
|
||||||
window.localStorage.clear(),
|
window.localStorage.clear(),
|
||||||
signOut({
|
session != null &&
|
||||||
callbackUrl: "/",
|
signOut({
|
||||||
});
|
callbackUrl: "/",
|
||||||
|
});
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{" "}
|
|
||||||
Go back home
|
Go back home
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user