import type { AuthContextValue } from '../types/auth.types.js'; /** * Returns the current auth context value from the nearest {@link AuthProvider}. * * Provides access to authentication state, login/logout methods, and token * retrieval for making authenticated API requests. * * @throws {AuthError} When called outside of an `AuthProvider`. * * @example * ```tsx * function Profile() { * const { user, logout, isAuthenticated } = useAuth(); * if (!isAuthenticated) return