From aa55c0475bdebaff20aa97a6ecaa00db7031891c Mon Sep 17 00:00:00 2001 From: Johannes Millan Date: Sat, 24 Jan 2026 13:14:35 +0100 Subject: [PATCH] feat(supersync): add preview deployments to default CORS origins --- packages/super-sync-server/src/config.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/super-sync-server/src/config.ts b/packages/super-sync-server/src/config.ts index 0dcf2e4188..ba1356e332 100644 --- a/packages/super-sync-server/src/config.ts +++ b/packages/super-sync-server/src/config.ts @@ -93,10 +93,14 @@ export interface ServerConfig { /** * Default CORS origins for production security. - * Only allows the official Super Productivity app. - * Use CORS_ORIGINS env var to add development origins (e.g., localhost). + * - Production app: exact match + * - Preview deployments: wildcard subdomain pattern + * Use CORS_ORIGINS env var to add additional origins. */ -const DEFAULT_CORS_ORIGINS: CorsOrigin[] = ['https://app.super-productivity.com']; +const DEFAULT_CORS_ORIGINS: CorsOrigin[] = [ + 'https://app.super-productivity.com', + /^https:\/\/[^\/]+\.super-productivity-preview\.pages\.dev$/, +]; const DEFAULT_CONFIG: ServerConfig = { port: 1900,