Removed redirect clientside session logic from pages and moved to shell
This commit is contained in:
@@ -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>
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user