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