From 2a95ce06b087341b9a1ac621d4ddd010ec01d560 Mon Sep 17 00:00:00 2001 From: Bruno Bernardino Date: Sat, 11 Jan 2025 07:14:02 +0000 Subject: [PATCH] Add example .env var, fix linting --- .env.sample | 1 + lib/config.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.env.sample b/.env.sample index 40d41d2..4cc1152 100644 --- a/.env.sample +++ b/.env.sample @@ -18,3 +18,4 @@ CONFIG_ENABLED_APPS="news,notes,photos" # dashboard and files cannot be disabled CONFIG_FILES_ROOT_PATH="data-files" CONFIG_ENABLE_EMAILS="false" # if true, email verification will be required for signups (using Brevo) CONFIG_ENABLE_FOREVER_SIGNUP="true" # if true, all signups become active for 100 years +# CONFIG_ALLOWED_COOKIE_DOMAINS="example.com,example.net" # can be set to allow more than the BASE_URL's domain for session cookies diff --git a/lib/config.ts b/lib/config.ts index 5ca1e5c..89d42fe 100644 --- a/lib/config.ts +++ b/lib/config.ts @@ -22,7 +22,7 @@ export function isAppEnabled(app: 'news' | 'notes' | 'photos') { export function isCookieDomainAllowed(domain: string) { const allowedDomains = (Deno.env.get('CONFIG_ALLOWED_COOKIE_DOMAINS') || '').split(',') as typeof domain[]; - + if (allowedDomains.length === 0) { return true; }