diff --git a/docker-compose.yml b/docker-compose.yml index 672a943..e41c370 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,6 +5,8 @@ services: restart: unless-stopped environment: - PORT=5173 + - PUBLIC_HTTPS_ONLY=false + - PUBLIC_SIGNUP_DISABLED=false volumes: - grimoire_data:/app/data/ build: diff --git a/src/lib/server/auth.ts b/src/lib/server/auth.ts index f24e1f8..b85b1a4 100644 --- a/src/lib/server/auth.ts +++ b/src/lib/server/auth.ts @@ -1,4 +1,4 @@ -import { dev } from '$app/environment'; +import config from '$lib/config'; import { db } from '$lib/database/db'; import { sessionSchema, userSchema } from '$lib/database/schema'; import { Lucia } from 'lucia'; @@ -6,13 +6,12 @@ import { Lucia } from 'lucia'; import { DrizzleSQLiteAdapter } from '@lucia-auth/adapter-drizzle'; import type { RequestEvent } from '@sveltejs/kit'; - export const adapter = new DrizzleSQLiteAdapter(db, sessionSchema, userSchema); export const lucia = new Lucia(adapter, { sessionCookie: { attributes: { - secure: !dev + secure: config.HTTPS_ONLY } }, getUserAttributes: (attributes) => {