first commit
This commit is contained in:
commit
c9fb67e751
423 files changed
+53287
No files matched your search
@@ -0,0 +1,16 @@
|
||||
import { useContext } from 'react';
|
||||
import { AuthContext } from '../contexts/AuthContext';
|
||||
|
||||
export function useAuth() {
|
||||
const context = useContext(AuthContext);
|
||||
|
||||
if (!context) {
|
||||
console.error('useAuth deve ser usado dentro de um AuthProvider');
|
||||
throw new Error('useAuth deve ser usado dentro de um AuthProvider');
|
||||
}
|
||||
|
||||
// Adicionar log para debug
|
||||
console.log('useAuth - Current user:', context.user);
|
||||
|
||||
return context;
|
||||
}
|
||||
Reference in new issue
Block a user