From 9026ac7fe309267bb77ee87e4cf4e73936f33dbe Mon Sep 17 00:00:00 2001 From: David Gwilliam Date: Sat, 25 Apr 2026 21:53:27 -0700 Subject: [PATCH] fix: update registration redirect and wordmark navigation - Simplify registration redirect after session refresh - Update wordmark to use dynamic href based on session/role - Add anchor tag for wordmark to avoid Next.js Link issues --- src/app/auth/register/page.tsx | 8 +++++--- src/components/Navigation.tsx | 14 ++++++++++++-- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/app/auth/register/page.tsx b/src/app/auth/register/page.tsx index f6b3c16..dfe8ff3 100644 --- a/src/app/auth/register/page.tsx +++ b/src/app/auth/register/page.tsx @@ -37,16 +37,18 @@ export default function RegisterPage() { } else { console.log("Signup successful, redirecting..."); console.log("Result data:", result.data); + // Refresh the session after successful registration try { - await refreshSession() + await refreshSession(); console.log("Session refreshed successfully"); } catch (err) { console.error("Failed to refresh session:", err); } + + // Redirect to admin page which will redirect to profile if not admin console.log("About to redirect to /admin"); - router.push("/admin") - router.refresh() + router.push("/admin"); console.log("Redirect initiated"); } } catch (err) { diff --git a/src/components/Navigation.tsx b/src/components/Navigation.tsx index efda8a3..6d20e0c 100644 --- a/src/components/Navigation.tsx +++ b/src/components/Navigation.tsx @@ -38,14 +38,24 @@ export default function Navigation() { window.location.href = '/auth/login' } + // Determine wordmark href based on session and role + const wordmarkHref = session + ? (userRole === "club_admin" || userRole === "site_admin") + ? "/admin" + : "/rankings" + : "/"; + return (