From e6396fa2dcf07c5851310f08912d9e7e35d78a57 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 58e2e2c6..f4527d23 100644 --- a/src/lib/components/UserHeader.svelte +++ b/src/lib/components/UserHeader.svelte @@ -1,5 +1,6 @@