From 6b703e0b915623f14b354796a8f574c3d3c121e9 Mon Sep 17 00:00:00 2001 From: Alexander Bocken Date: Sun, 31 Aug 2025 22:02:19 +0200 Subject: [PATCH] Remove ugly spinner pages from auth flow - Replace loading spinners and styling with minimal HTML pages - Auth flow now happens almost instantly without visible intermediary screens - Reduced bundle size for login/logout endpoints (0.59kB and 0.58kB) - Maintains seamless user experience while preserving Auth.js integration - Users stay on current page context during auth transitions --- src/routes/login/+server.ts | 12 +++--------- src/routes/logout/+server.ts | 12 +++--------- 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/src/routes/login/+server.ts b/src/routes/login/+server.ts index f0a20fed..da37db3c 100644 --- a/src/routes/login/+server.ts +++ b/src/routes/login/+server.ts @@ -3,25 +3,19 @@ import type { RequestHandler } from './$types'; export const GET: RequestHandler = async ({ url }) => { const callbackUrl = url.searchParams.get('callbackUrl') || '/'; - // Create an auto-submitting form that POSTs to Auth.js signin + // Create a minimal page that immediately triggers auth in the same window const html = ` - Redirecting to login... - + Login -

Redirecting to login...

-
diff --git a/src/routes/logout/+server.ts b/src/routes/logout/+server.ts index ab301f86..301b3029 100644 --- a/src/routes/logout/+server.ts +++ b/src/routes/logout/+server.ts @@ -3,25 +3,19 @@ import type { RequestHandler } from './$types'; export const GET: RequestHandler = async ({ url }) => { const callbackUrl = url.searchParams.get('callbackUrl') || '/'; - // Create an auto-submitting form that POSTs to Auth.js signout + // Create a minimal page that immediately triggers logout in the same window const html = ` - Signing out... - + Logout -

Signing out...

-