Spaces:
Paused
Paused
Download frontend/packages/shared/src/hooks/useAuth.ts from 3SCError404/miracle: direct link, hf CLI and curl.
- Browser
- Download file 290 Bytes
-
https://huggingface.co/spaces/3SCError404/miracle/resolve/main/frontend/packages/shared/src/hooks/useAuth.ts
- Command line
-
hf download hf://spaces/3SCError404/miracle/frontend/packages/shared/src/hooks/useAuth.ts
-
curl -L -o useAuth.ts https://huggingface.co/spaces/3SCError404/miracle/resolve/main/frontend/packages/shared/src/hooks/useAuth.ts
290 Bytes
| import { useContext } from 'react'; | |
| import { AuthContext } from '../contexts/AuthContext'; | |
| export const useAuth = () => { | |
| const context = useContext(AuthContext); | |
| if (context === undefined) { | |
| throw new Error('useAuth must be used within an AuthProvider'); | |
| } | |
| return context; | |
| }; | |