From 9135b5e5c9d684fe3ddbf495783a463a51dfece3 Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Tue, 14 Oct 2025 14:05:48 +0000 Subject: [PATCH] Fix: Wrap useAuth in AuthProvider --- src/hooks/useAuth.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/hooks/useAuth.tsx b/src/hooks/useAuth.tsx index a5cad96b..f0cd114f 100644 --- a/src/hooks/useAuth.tsx +++ b/src/hooks/useAuth.tsx @@ -241,6 +241,7 @@ export const AuthProvider = AuthProviderComponent; export function useAuth() { const context = useContext(AuthContext); if (context === undefined) { + console.error('[useAuth] AuthContext is undefined - component may be rendering outside AuthProvider'); throw new Error('useAuth must be used within an AuthProvider'); } return context;