From 660bf32fdc7dfb0d8cda14a42763efec6382876b Mon Sep 17 00:00:00 2001 From: soufiane Date: Tue, 18 Nov 2025 20:10:25 +0100 Subject: [PATCH] fix: ensure GoogleOAuthProvider is always available to prevent context errors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Update providers to always render GoogleOAuthProvider with dummy ID when not configured - This prevents "must be used within GoogleOAuthProvider" errors during SSR - The login page still checks for valid client ID before showing Google button - Fixes dev mode errors and ensures consistent behavior 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- app/providers.tsx | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/app/providers.tsx b/app/providers.tsx index b0b3fa1..47b750c 100644 --- a/app/providers.tsx +++ b/app/providers.tsx @@ -5,21 +5,15 @@ import { AuthProvider } from "@/contexts/AuthContext"; import { ReactNode } from "react"; export function Providers({ children }: { children: ReactNode }) { - const googleClientId = process.env.NEXT_PUBLIC_GOOGLE_CLIENT_ID || ''; + // Use a dummy client ID if not provided to prevent context errors + // The actual authentication will still check for a valid ID + const googleClientId = process.env.NEXT_PUBLIC_GOOGLE_CLIENT_ID || 'dummy-client-id-not-configured'; - const content = ( - - {children} - + return ( + + + {children} + + ); - - if (googleClientId) { - return ( - - {content} - - ); - } - - return content; }