Spaces:
Sleeping
Sleeping
Download frontend/src/hooks/useAuth.ts from orakzai-io/Rednote: direct link, hf CLI and curl.
- Browser
- Download file 280 Bytes
-
https://huggingface.co/spaces/orakzai-io/Rednote/resolve/main/frontend/src/hooks/useAuth.ts
- Command line
-
hf download hf://spaces/orakzai-io/Rednote/frontend/src/hooks/useAuth.ts
-
curl -L -o useAuth.ts https://huggingface.co/spaces/orakzai-io/Rednote/resolve/main/frontend/src/hooks/useAuth.ts
280 Bytes
| import { useContext } from 'react'; | |
| import { AuthContext } from '../context/AuthContext'; | |
| export function useAuth() { | |
| const context = useContext(AuthContext); | |
| if (!context) { | |
| throw new Error('useAuth must be used within an AuthProvider'); | |
| } | |
| return context; | |
| } |