From 1ddd3512429f23e21a0da5e14b7b3d4d8335fe95 Mon Sep 17 00:00:00 2001 From: Jayvin Hernandez Date: Wed, 10 May 2023 22:39:08 -0700 Subject: [PATCH] fix: things (#401) * fix: use relative path for volumes * fix: null check oauth config * fix: attempt refresh if error is on /dashboard --------- Co-authored-by: dicedtomato <35403473+diced@users.noreply.github.com> --- docker-compose.dev.yml | 4 ++-- docker-compose.yml | 2 +- src/lib/middleware/getServerSideProps.ts | 2 +- src/pages/500.tsx | 12 +++++++++--- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index 43b1022..3d158e2 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -23,8 +23,8 @@ services: env_file: - .env.local volumes: - - '$PWD/uploads:/zipline/uploads' - - '$PWD/public:/zipline/public' + - './uploads:/zipline/uploads' + - './public:/zipline/public' depends_on: - 'postgres' diff --git a/docker-compose.yml b/docker-compose.yml index d3cc2f3..d42369c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -29,7 +29,7 @@ services: - CORE_LOGGER=true volumes: - './uploads:/zipline/uploads' - - '$PWD/public:/zipline/public' + - './public:/zipline/public' depends_on: - 'postgres' diff --git a/src/lib/middleware/getServerSideProps.ts b/src/lib/middleware/getServerSideProps.ts index 44bf4f6..209f01b 100644 --- a/src/lib/middleware/getServerSideProps.ts +++ b/src/lib/middleware/getServerSideProps.ts @@ -61,7 +61,7 @@ export const getServerSideProps: GetServerSideProps = async (ct user_registration: config.features.user_registration, oauth_registration: config.features.oauth_registration, oauth_providers: JSON.stringify(oauth_providers), - bypass_local_login: config.oauth.bypass_local_login, + bypass_local_login: config.oauth?.bypass_local_login ?? false, chunks_size: config.chunks.chunks_size, max_size: config.chunks.max_size, totp_enabled: config.mfa.totp_enabled, diff --git a/src/pages/500.tsx b/src/pages/500.tsx index ad84d61..e6f3e15 100644 --- a/src/pages/500.tsx +++ b/src/pages/500.tsx @@ -2,8 +2,10 @@ import { Button, Stack, Title, Tooltip } from '@mantine/core'; import MutedText from 'components/MutedText'; import Head from 'next/head'; import Link from 'next/link'; +import { useRouter } from 'next/router'; export default function FiveHundred() { + const { asPath } = useRouter(); return ( <> @@ -24,9 +26,13 @@ export default function FiveHundred() { Internal server error - + {asPath === '/dashboard' ? ( + + ) : ( + + )} );