fix: use process.env instead of sveltekit env

This commit is contained in:
2025-01-22 04:32:47 +01:00
parent ab289b49c9
commit 24719267d2
3 changed files with 547 additions and 176 deletions

View File

@@ -1,9 +1,8 @@
import * as schema from './schema';
import { drizzle } from 'drizzle-orm/postgres-js';
import { DB_URL } from '$env/static/private';
import postgres from 'postgres';
const client = postgres(DB_URL, { prepare: false });
const client = postgres(process.env.DB_URL, { prepare: false });
export const db = drizzle({
schema,
client

View File

@@ -1,5 +1,3 @@
import { AUTH_TOKEN } from '$env/static/private';
export const actions = {
authenticate: async ({ request, cookies }) => {
const data = await request.formData();
@@ -12,7 +10,7 @@ export const actions = {
};
}
if (token !== AUTH_TOKEN) {
if (token !== process.env.AUTH_TOKEN) {
return {
status: 401,
body: { error: 'Invalid token' }