From bf9b359cd6f3f70b2dbdf371f82b36352929e3f1 Mon Sep 17 00:00:00 2001 From: Usman Baig Date: Thu, 22 Jan 2026 16:01:54 +0100 Subject: [PATCH] fix(auth): prevent redirect loops during auth callback processing in AuthProvider --- lib/auth/context.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/auth/context.tsx b/lib/auth/context.tsx index 0ddd3ba..76da82d 100644 --- a/lib/auth/context.tsx +++ b/lib/auth/context.tsx @@ -107,6 +107,9 @@ export function AuthProvider({ children }: { children: React.ReactNode }) { if (!loading && user) { // * If we are on onboarding, skip check if (pathname?.startsWith('/onboarding')) return + + // * If we are processing auth callback, skip check to avoid redirect loops + if (pathname?.startsWith('/auth/callback')) return try { const organizations = await getUserOrganizations()