mirror of
https://github.com/Litlyx/litlyx
synced 2025-12-10 07:48:37 +01:00
fix selfhost
This commit is contained in:
@@ -3,5 +3,5 @@
|
|||||||
const app = useRuntimeConfig();
|
const app = useRuntimeConfig();
|
||||||
|
|
||||||
export function useSelfhosted() {
|
export function useSelfhosted() {
|
||||||
return app.public.SELFHOSTED === 'TRUE' || app.public.SELFHOSTED !== 'true';
|
return app.public.SELFHOSTED === 'TRUE' || app.public.SELFHOSTED === 'true';
|
||||||
}
|
}
|
||||||
@@ -12,6 +12,8 @@ const modal = useModal();
|
|||||||
|
|
||||||
const selfhosted = useSelfhosted();
|
const selfhosted = useSelfhosted();
|
||||||
|
|
||||||
|
console.log({ selfhosted })
|
||||||
|
|
||||||
const sections: Section[] = [
|
const sections: Section[] = [
|
||||||
{
|
{
|
||||||
title: '',
|
title: '',
|
||||||
|
|||||||
@@ -55,8 +55,8 @@ export default defineNuxtConfig({
|
|||||||
STRIPE_SECRET_TEST: process.env.STRIPE_SECRET_TEST,
|
STRIPE_SECRET_TEST: process.env.STRIPE_SECRET_TEST,
|
||||||
STRIPE_WH_SECRET_TEST: process.env.STRIPE_WH_SECRET_TEST,
|
STRIPE_WH_SECRET_TEST: process.env.STRIPE_WH_SECRET_TEST,
|
||||||
NOAUTH_USER_EMAIL: process.env.NOAUTH_USER_EMAIL,
|
NOAUTH_USER_EMAIL: process.env.NOAUTH_USER_EMAIL,
|
||||||
NOAUTH_USER_NAME: process.env.NOAUTH_USER_NAME || 'FALSE',
|
NOAUTH_USER_NAME: process.env.NOAUTH_USER_NAME,
|
||||||
SELFHOSTED: process.env.SELFHOSTED,
|
SELFHOSTED: process.env.SELFHOSTED || 'FALSE',
|
||||||
public: {
|
public: {
|
||||||
AUTH_MODE: process.env.AUTH_MODE,
|
AUTH_MODE: process.env.AUTH_MODE,
|
||||||
GITHUB_CLIENT_ID: process.env.GITHUB_AUTH_CLIENT_ID || 'NONE',
|
GITHUB_CLIENT_ID: process.env.GITHUB_AUTH_CLIENT_ID || 'NONE',
|
||||||
|
|||||||
@@ -1,11 +1,17 @@
|
|||||||
|
|
||||||
import { OnboardingModel } from '@schema/OnboardingSchema';
|
import { OnboardingModel } from '@schema/OnboardingSchema';
|
||||||
|
|
||||||
|
|
||||||
|
const { SELFHOSTED } = useRuntimeConfig();
|
||||||
|
|
||||||
export default defineEventHandler(async event => {
|
export default defineEventHandler(async event => {
|
||||||
const data = await getRequestData(event);
|
const data = await getRequestData(event);
|
||||||
if (!data) return;
|
if (!data) return;
|
||||||
|
|
||||||
const exist = await OnboardingModel.exists({ user_id: data.user.id });
|
const exist = await OnboardingModel.exists({ user_id: data.user.id });
|
||||||
|
|
||||||
|
if (SELFHOSTED === 'TRUE' || SELFHOSTED === 'true') {
|
||||||
|
return { exists: true }
|
||||||
|
}
|
||||||
return { exist: exist != null }
|
return { exist: exist != null }
|
||||||
});
|
});
|
||||||
Reference in New Issue
Block a user