From dbcda958232346796298d84559b673828d1a5c26 Mon Sep 17 00:00:00 2001 From: Emily Date: Fri, 17 Jan 2025 17:40:20 +0100 Subject: [PATCH] fix selfhost --- dashboard/composables/useSelfhosted.ts | 2 +- dashboard/layouts/dashboard.vue | 2 ++ dashboard/nuxt.config.ts | 4 ++-- dashboard/server/api/onboarding/exist.ts | 6 ++++++ 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/dashboard/composables/useSelfhosted.ts b/dashboard/composables/useSelfhosted.ts index 8df1f34..4d54781 100644 --- a/dashboard/composables/useSelfhosted.ts +++ b/dashboard/composables/useSelfhosted.ts @@ -3,5 +3,5 @@ const app = useRuntimeConfig(); export function useSelfhosted() { - return app.public.SELFHOSTED === 'TRUE' || app.public.SELFHOSTED !== 'true'; + return app.public.SELFHOSTED === 'TRUE' || app.public.SELFHOSTED === 'true'; } \ No newline at end of file diff --git a/dashboard/layouts/dashboard.vue b/dashboard/layouts/dashboard.vue index 56e172e..e9fa1e1 100644 --- a/dashboard/layouts/dashboard.vue +++ b/dashboard/layouts/dashboard.vue @@ -12,6 +12,8 @@ const modal = useModal(); const selfhosted = useSelfhosted(); +console.log({ selfhosted }) + const sections: Section[] = [ { title: '', diff --git a/dashboard/nuxt.config.ts b/dashboard/nuxt.config.ts index a912c52..33a254d 100644 --- a/dashboard/nuxt.config.ts +++ b/dashboard/nuxt.config.ts @@ -55,8 +55,8 @@ export default defineNuxtConfig({ STRIPE_SECRET_TEST: process.env.STRIPE_SECRET_TEST, STRIPE_WH_SECRET_TEST: process.env.STRIPE_WH_SECRET_TEST, NOAUTH_USER_EMAIL: process.env.NOAUTH_USER_EMAIL, - NOAUTH_USER_NAME: process.env.NOAUTH_USER_NAME || 'FALSE', - SELFHOSTED: process.env.SELFHOSTED, + NOAUTH_USER_NAME: process.env.NOAUTH_USER_NAME, + SELFHOSTED: process.env.SELFHOSTED || 'FALSE', public: { AUTH_MODE: process.env.AUTH_MODE, GITHUB_CLIENT_ID: process.env.GITHUB_AUTH_CLIENT_ID || 'NONE', diff --git a/dashboard/server/api/onboarding/exist.ts b/dashboard/server/api/onboarding/exist.ts index 6bf6c55..94dcd78 100644 --- a/dashboard/server/api/onboarding/exist.ts +++ b/dashboard/server/api/onboarding/exist.ts @@ -1,11 +1,17 @@ import { OnboardingModel } from '@schema/OnboardingSchema'; + +const { SELFHOSTED } = useRuntimeConfig(); + export default defineEventHandler(async event => { const data = await getRequestData(event); if (!data) return; const exist = await OnboardingModel.exists({ user_id: data.user.id }); + if (SELFHOSTED === 'TRUE' || SELFHOSTED === 'true') { + return { exists: true } + } return { exist: exist != null } }); \ No newline at end of file