Removed redirect clientside session logic from pages and moved to shell

This commit is contained in:
Alex van Andel
2021-05-07 16:01:29 +00:00
parent 17b880335a
commit 880c4e91a3
8 changed files with 27 additions and 40 deletions
+7 -4
View File
@@ -27,11 +27,14 @@ export default function Shell(props) {
}
const logoutHandler = () => {
signOut();
router.push('/');
signOut({ redirect: false }).then( () => router.push('/auth/logout') );
}
return (
if ( ! loading && ! session ) {
router.replace('/auth/login');
}
return session && (
<div>
<div className="bg-gray-800 pb-32">
<nav className="bg-gray-800">
@@ -146,4 +149,4 @@ export default function Shell(props) {
</main>
</div>
);
}
}