fix: use process.env instead of sveltekit env
This commit is contained in:
716
packages/web/package-lock.json
generated
Executable file → Normal file
716
packages/web/package-lock.json
generated
Executable file → Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,9 +1,8 @@
|
|||||||
import * as schema from './schema';
|
import * as schema from './schema';
|
||||||
import { drizzle } from 'drizzle-orm/postgres-js';
|
import { drizzle } from 'drizzle-orm/postgres-js';
|
||||||
import { DB_URL } from '$env/static/private';
|
|
||||||
import postgres from 'postgres';
|
import postgres from 'postgres';
|
||||||
|
|
||||||
const client = postgres(DB_URL, { prepare: false });
|
const client = postgres(process.env.DB_URL, { prepare: false });
|
||||||
export const db = drizzle({
|
export const db = drizzle({
|
||||||
schema,
|
schema,
|
||||||
client
|
client
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
import { AUTH_TOKEN } from '$env/static/private';
|
|
||||||
|
|
||||||
export const actions = {
|
export const actions = {
|
||||||
authenticate: async ({ request, cookies }) => {
|
authenticate: async ({ request, cookies }) => {
|
||||||
const data = await request.formData();
|
const data = await request.formData();
|
||||||
@@ -12,7 +10,7 @@ export const actions = {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
if (token !== AUTH_TOKEN) {
|
if (token !== process.env.AUTH_TOKEN) {
|
||||||
return {
|
return {
|
||||||
status: 401,
|
status: 401,
|
||||||
body: { error: 'Invalid token' }
|
body: { error: 'Invalid token' }
|
||||||
|
|||||||
Reference in New Issue
Block a user