Download src/lib/auth/useAuth.ts from asnannp/DocDoeAI: direct link, hf CLI and curl.
- Browser
- Download file 294 Bytes
-
https://huggingface.co/spaces/asnannp/DocDoeAI/resolve/main/src/lib/auth/useAuth.ts
- Command line
-
hf download hf://spaces/asnannp/DocDoeAI/src/lib/auth/useAuth.ts
-
curl -L -o useAuth.ts https://huggingface.co/spaces/asnannp/DocDoeAI/resolve/main/src/lib/auth/useAuth.ts
294 Bytes
| "use client"; | |
| import { useContext } from "react"; | |
| import { AuthContext } from "@/lib/auth/AuthProvider"; | |
| export function useAuth() { | |
| const context = useContext(AuthContext); | |
| if (context === null) { | |
| throw new Error("useAuth must be used inside AuthProvider."); | |
| } | |
| return context; | |
| } | |