mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-22 17:31:15 -05:00
Fix: Wrap useAuth in AuthProvider
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user