Removed redirect clientside session logic from pages and moved to shell
This commit is contained in:
1 parent
17b880335a
commit
880c4e91a3
8 files changed
+27
-40
No files matched your search
@@ -15,10 +15,6 @@ export default function Settings(props) {
|
||||
|
||||
if (loading) {
|
||||
return <p className="text-gray-400">Loading...</p>;
|
||||
} else {
|
||||
if (!session) {
|
||||
window.location.href = "/auth/login";
|
||||
}
|
||||
}
|
||||
|
||||
const closeSuccessModal = () => { setSuccessModalOpen(false); }
|
||||
@@ -88,6 +84,9 @@ export default function Settings(props) {
|
||||
|
||||
export async function getServerSideProps(context) {
|
||||
const session = await getSession(context);
|
||||
if (!session) {
|
||||
return { redirect: { permanent: false, destination: '/auth/login' } };
|
||||
}
|
||||
|
||||
const user = await prisma.user.findFirst({
|
||||
where: {
|
||||
|
||||
@@ -22,10 +22,6 @@ export default function Settings(props) {
|
||||
|
||||
if (loading) {
|
||||
return <p className="text-gray-400">Loading...</p>;
|
||||
} else {
|
||||
if (!session) {
|
||||
window.location.href = "/auth/login";
|
||||
}
|
||||
}
|
||||
|
||||
const closeSuccessModal = () => { setSuccessModalOpen(false); }
|
||||
@@ -159,6 +155,9 @@ export default function Settings(props) {
|
||||
|
||||
export async function getServerSideProps(context) {
|
||||
const session = await getSession(context);
|
||||
if (!session) {
|
||||
return { redirect: { permanent: false, destination: '/auth/login' } };
|
||||
}
|
||||
|
||||
const user = await prisma.user.findFirst({
|
||||
where: {
|
||||
|
||||
Reference in new issue
Block a user