@@ -353,6 +349,9 @@ export default function Availability(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: {
@@ -382,4 +381,4 @@ export async function getServerSideProps(context) {
return {
props: {user, types}, // will be passed to the page component as props
}
-}
+}
\ No newline at end of file
diff --git a/pages/index.tsx b/pages/index.tsx
index 572fad7b..7501b905 100644
--- a/pages/index.tsx
+++ b/pages/index.tsx
@@ -6,14 +6,9 @@ import { signIn, useSession, getSession } from 'next-auth/client';
export default function Home(props) {
const [ session, loading ] = useSession();
-
if (loading) {
return
Loading...
;
}
- if (!session) {
- window.location.href = "/auth/login";
- return;
- }
return(
diff --git a/pages/integrations/[integration].tsx b/pages/integrations/[integration].tsx
index 6366122a..97849c39 100644
--- a/pages/integrations/[integration].tsx
+++ b/pages/integrations/[integration].tsx
@@ -13,10 +13,6 @@ export default function integration(props) {
if (loading) {
return
Loading...
;
- } else {
- if (!session) {
- window.location.href = "/";
- }
}
function toggleShowAPIKey() {
diff --git a/pages/integrations/index.tsx b/pages/integrations/index.tsx
index 76e16a34..8cc36a67 100644
--- a/pages/integrations/index.tsx
+++ b/pages/integrations/index.tsx
@@ -13,10 +13,6 @@ export default function Home({ integrations }) {
if (loading) {
return
Loading...
;
- } else {
- if (!session) {
- window.location.href = "/";
- }
}
function toggleAddModal() {
@@ -181,7 +177,9 @@ const validJson = (jsonString: string) => {
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: {
email: session.user.email,
diff --git a/pages/settings/password.tsx b/pages/settings/password.tsx
index cb937516..edeb06b0 100644
--- a/pages/settings/password.tsx
+++ b/pages/settings/password.tsx
@@ -15,10 +15,6 @@ export default function Settings(props) {
if (loading) {
return
Loading...
;
- } 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: {
diff --git a/pages/settings/profile.tsx b/pages/settings/profile.tsx
index 7974ad40..74aa19b5 100644
--- a/pages/settings/profile.tsx
+++ b/pages/settings/profile.tsx
@@ -22,10 +22,6 @@ export default function Settings(props) {
if (loading) {
return
Loading...
;
- } 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: {
diff --git a/public/calendso-logo-white-word.svg b/public/calendso-logo-white-word.svg
new file mode 100644
index 00000000..6e91c4b6
--- /dev/null
+++ b/public/calendso-logo-white-word.svg
@@ -0,0 +1,41 @@
+
+
+
diff --git a/public/calendso-logo-word.svg b/public/calendso-logo-word.svg
new file mode 100644
index 00000000..4a01ade1
--- /dev/null
+++ b/public/calendso-logo-word.svg
@@ -0,0 +1,41 @@
+
+
+