aubm / frontend /src /context /useAuth.ts
cesjavi's picture
Deploy Aubm Docker Space
81ff144
raw
history blame contribute delete
285 Bytes
import { useContext } from 'react';
import { AuthContext } from './authContextValue';
export const useAuth = () => {
const context = useContext(AuthContext);
if (context === undefined) {
throw new Error('useAuth must be used within an AuthProvider');
}
return context;
};