Fix: Wrap useAuth in AuthProvider

This commit is contained in:
gpt-engineer-app[bot]
2025-10-14 14:05:48 +00:00
parent a858b266e6
commit 9135b5e5c9

View File

@@ -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;