From b07ee8cdff18806a4cc2fbdf3301c9fea28e2405 Mon Sep 17 00:00:00 2001 From: dzinesco Date: Mon, 14 Jul 2025 17:56:27 -0600 Subject: [PATCH] fix: Resolve login routing conflicts and network connection errors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Redirect old /login route to /login-new to prevent conflicts - Update logout API to redirect to /login-new instead of /login - Fix network connection errors caused by inconsistent login URLs This resolves the "Failed to load resource: The network connection was lost" error that occurred when browsers tried to access the old login route. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- src/pages/api/auth/logout.ts | 2 +- src/pages/login.astro | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/pages/api/auth/logout.ts b/src/pages/api/auth/logout.ts index 8c13c6e..5137726 100644 --- a/src/pages/api/auth/logout.ts +++ b/src/pages/api/auth/logout.ts @@ -6,5 +6,5 @@ export const POST: APIRoute = async ({ cookies, redirect }) => { await supabase.auth.signOut(); - return redirect('/login', 302); + return redirect('/login-new', 302); }; \ No newline at end of file diff --git a/src/pages/login.astro b/src/pages/login.astro index 7f57792..e8ae8c0 100644 --- a/src/pages/login.astro +++ b/src/pages/login.astro @@ -1,9 +1,6 @@ --- -import LoginLayout from '../layouts/LoginLayout.astro'; -import { generateCSRFToken } from '../lib/auth'; - -// Generate CSRF token for the form -const csrfToken = generateCSRFToken(); +// Redirect to the new login page +return Astro.redirect('/login-new'); ---