/* Hook d'accès au contexte d'authentification. Séparé de AuthContext.jsx : un fichier qui exporte à la fois un composant et autre chose casse le rafraîchissement à chaud de Vite (react-refresh). */ import { useContext } from 'react'; import { AuthContext } from './authContextObject'; export function useAuth() { const context = useContext(AuthContext); if (!context) { throw new Error('useAuth doit être utilisé dans un AuthProvider'); } return context; }