From 83264b4b41369b533493f2637a8fcdeb0fbb73d5 Mon Sep 17 00:00:00 2001 From: vikingowl Date: Fri, 27 Feb 2026 14:12:23 +0100 Subject: [PATCH] fix: enable auth nav, turnstile deployment, country dropdown, profile routes - Add PUBLIC_TURNSTILE_SITE_KEY as Docker build arg and Woodpecker CI arg - Uncomment auth nav in Header and MobileNav (login/logout/profile links) - Move ThemeToggle from header to footer - Expand country dropdown from DACH-only to all European countries - Replace profile route redirect with requireAuth guard - Set cookie secure flag based on environment (secure in prod) - Add error handling to admin markets page (403 instead of 500) --- web/.woodpecker.yml | 1 + web/Dockerfile | 3 ++ web/src/lib/auth/cookies.ts | 3 +- web/src/lib/components/layout/Footer.svelte | 19 ++++--- web/src/lib/components/layout/Header.svelte | 17 +++---- .../lib/components/layout/MobileNav.svelte | 18 ++++--- web/src/routes/admin/maerkte/+page.server.ts | 24 ++++++--- web/src/routes/markt/einreichen/+page.svelte | 50 +++++++++++++++++-- web/src/routes/profile/+layout.server.ts | 7 ++- 9 files changed, 103 insertions(+), 39 deletions(-) diff --git a/web/.woodpecker.yml b/web/.woodpecker.yml index 52dcb6e..1fd98ba 100644 --- a/web/.woodpecker.yml +++ b/web/.woodpecker.yml @@ -29,6 +29,7 @@ steps: from_secret: registry_password build_args: - PUBLIC_API_BASE_URL=https://api.marktvogt.de + - PUBLIC_TURNSTILE_SITE_KEY=0x4AAAAAAACjLCV-78Q1loTPz when: - event: push branch: main diff --git a/web/Dockerfile b/web/Dockerfile index 0d19ec2..4e3b3be 100644 --- a/web/Dockerfile +++ b/web/Dockerfile @@ -20,6 +20,9 @@ COPY . . ARG PUBLIC_API_BASE_URL=https://api.marktvogt.de ENV PUBLIC_API_BASE_URL=$PUBLIC_API_BASE_URL +ARG PUBLIC_TURNSTILE_SITE_KEY=1x00000000000000000000AA +ENV PUBLIC_TURNSTILE_SITE_KEY=$PUBLIC_TURNSTILE_SITE_KEY + RUN bun run build # ───────────────────────────────────────────── diff --git a/web/src/lib/auth/cookies.ts b/web/src/lib/auth/cookies.ts index 3dd4aeb..ade877c 100644 --- a/web/src/lib/auth/cookies.ts +++ b/web/src/lib/auth/cookies.ts @@ -1,10 +1,11 @@ +import { dev } from '$app/environment'; import type { Cookies } from '@sveltejs/kit'; import type { AuthData } from '$lib/api/types.js'; const COOKIE_OPTS = { path: '/', httpOnly: true, - secure: false, // TODO: set to true in production + secure: !dev, sameSite: 'lax' as const }; diff --git a/web/src/lib/components/layout/Footer.svelte b/web/src/lib/components/layout/Footer.svelte index 8fedf15..ba685ed 100644 --- a/web/src/lib/components/layout/Footer.svelte +++ b/web/src/lib/components/layout/Footer.svelte @@ -1,13 +1,20 @@ + + diff --git a/web/src/lib/components/layout/Header.svelte b/web/src/lib/components/layout/Header.svelte index 2b2acc8..a0d4886 100644 --- a/web/src/lib/components/layout/Header.svelte +++ b/web/src/lib/components/layout/Header.svelte @@ -1,7 +1,6 @@