From 2f4c3ac1aefb73d855246cd9604ccdac8c2f6a64 Mon Sep 17 00:00:00 2001 From: Alexander Bocken Date: Thu, 26 Feb 2026 19:25:43 +0100 Subject: [PATCH] auth: smart login/logout redirect back to original page Login link now includes callbackUrl for the current page. Logout redirects intelligently: stays on public pages, falls back to the recipe detail for /edit/[name], to the recipe root for auth-only sub-routes (add, favorites, to-try, admin), and to / for cospend. --- src/lib/components/UserHeader.svelte | 28 +++++++++++++++++-- .../favorites/+page.server.ts | 3 +- .../to-try/+page.server.ts | 7 ++++- 3 files changed, 34 insertions(+), 4 deletions(-) diff --git a/src/lib/components/UserHeader.svelte b/src/lib/components/UserHeader.svelte index 58e2e2c..f4527d2 100644 --- a/src/lib/components/UserHeader.svelte +++ b/src/lib/components/UserHeader.svelte @@ -1,5 +1,6 @@