From c0a8451bccb9686258a94a9c11a9cc8f29804e03 Mon Sep 17 00:00:00 2001 From: Georgios Jason Efstathiou Date: Tue, 21 Jul 2026 16:50:07 +0200 Subject: [PATCH 1/2] stop login callback re-redeeming the oauth code on reload MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit the redeem takes ~1.5s (github exchange), which on slow connections invites a reload mid-flight. the reloaded callback page then re-posted the same single-use code, got "OAuth session already used" back, and showed the generic error screen — even when the first attempt had succeeded server-side with its response lost. mark the code as attempted in sessionStorage before redeeming; a later load seeing the marker skips straight to the login page (which bounces to backTo if a session exists, and re-authorizes instantly otherwise). also surface the backend's actual error message instead of blaming github for everything, and carry backTo through the try-again button. --- .../wave/(flows)/login/callback/+page.svelte | 27 +++++++-- .../(flows)/login/callback/perform-login.ts | 60 ++++++++++++++++++- 2 files changed, 80 insertions(+), 7 deletions(-) diff --git a/src/routes/(pages)/wave/(flows)/login/callback/+page.svelte b/src/routes/(pages)/wave/(flows)/login/callback/+page.svelte index 0cddf1131..2672ba3fb 100644 --- a/src/routes/(pages)/wave/(flows)/login/callback/+page.svelte +++ b/src/routes/(pages)/wave/(flows)/login/callback/+page.svelte @@ -1,17 +1,21 @@