mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-23 15:31:13 -05:00
Fix: Wrap useAuth in AuthProvider
This commit is contained in:
@@ -241,6 +241,7 @@ export const AuthProvider = AuthProviderComponent;
|
|||||||
export function useAuth() {
|
export function useAuth() {
|
||||||
const context = useContext(AuthContext);
|
const context = useContext(AuthContext);
|
||||||
if (context === undefined) {
|
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');
|
throw new Error('useAuth must be used within an AuthProvider');
|
||||||
}
|
}
|
||||||
return context;
|
return context;
|
||||||
|
|||||||
Reference in New Issue
Block a user