diff --git a/hooks/useGame.ts b/hooks/useGame.ts index 23b6b6f..aaebab7 100644 --- a/hooks/useGame.ts +++ b/hooks/useGame.ts @@ -204,8 +204,8 @@ export const useGame = (defaultGameConfig?: GameConfig) => { if (auth.isLoading) return; const getTargetPath = () => { + // Don't interfere with special routes unless we have an active game if ( - location.pathname === '/callback' || location.pathname.startsWith('/shared/') || location.pathname === '/upgrade' || location.pathname === '/payment/success' || @@ -214,6 +214,12 @@ export const useGame = (defaultGameConfig?: GameConfig) => { return null; } + // For /callback, only skip navigation if we're in LANDING state (auth still processing) + // Once a game starts, we should navigate to the proper game URL + if (location.pathname === '/callback' && gameState === 'LANDING') { + return null; + } + // Don't redirect away from game URLs during initial load - let initializeFromUrl handle it const isGameUrl = /^\/host\/[A-Z0-9]+$/i.test(location.pathname) || /^\/play\/[A-Z0-9]+$/i.test(location.pathname);