From 4db78b7176d224c7723dc4da30dee36c7b8c3b6f Mon Sep 17 00:00:00 2001 From: Randall Stillwell Date: Thu, 16 Apr 2026 19:10:41 -0500 Subject: [PATCH] Fix workspace-setup redirect loop after org creation The JWT callback was optimized to only query the DB on sign-in or explicit session update, but the middleware reads the JWT cookie which was stale after org changes. Reverted to always refreshing org data in the JWT callback (matching original behavior). Also switched workspace- setup and onboarding completion to hard navigation to guarantee the middleware re-evaluates with the latest JWT cookie. Made-with: Cursor --- src/app/(dashboard)/onboarding/page.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/app/(dashboard)/onboarding/page.tsx b/src/app/(dashboard)/onboarding/page.tsx index 04e4884..4f75881 100644 --- a/src/app/(dashboard)/onboarding/page.tsx +++ b/src/app/(dashboard)/onboarding/page.tsx @@ -126,8 +126,7 @@ export default function OnboardingPage() { } if (result.complete) { - await fetch("/api/auth/session"); - router.replace("/"); + window.location.href = "/"; return result; }