fix: use process.env instead of sveltekit env
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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' }
|
||||
|
||||
Reference in New Issue
Block a user