From 7e8545f8dbe86e16f1b2740a90170f71acf8f684 Mon Sep 17 00:00:00 2001 From: Davide Scaini Date: Wed, 3 Jun 2026 11:33:37 +0200 Subject: [PATCH] fix: redirect back to activity.bincio.org after login via bincio.org Pass ?next= when bouncing to bincio.org/login/ so the user lands back on the activity page they came from instead of bincio.org/. --- site/src/layouts/Base.astro | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/site/src/layouts/Base.astro b/site/src/layouts/Base.astro index 9dff883..bf1d2de 100644 --- a/site/src/layouts/Base.astro +++ b/site/src/layouts/Base.astro @@ -104,7 +104,8 @@ try { fetch('/api/me', { credentials: 'include' }) .then(r => { if (r.status === 401 || r.status === 404) { - window.location.replace(authUrl ? authUrl + '/login/' : '/login/'); + const next = authUrl ? '?next=' + encodeURIComponent(window.location.href) : ''; + window.location.replace(authUrl ? authUrl + '/login/' + next : '/login/'); } else { document.body.removeAttribute('data-auth-pending'); }