grok2api / frontend /src /shared /auth /use-auth.ts
fromozuzhouzzz
Deploy grok2api v3.0.11 to HF Spaces
f1dd159
Raw
History Blame Contribute Delete
308 Bytes
import { useContext } from "react";
import { AuthContext, type AuthContextValue } from "@/shared/auth/auth-state";
export function useAuth(): AuthContextValue {
const value = useContext(AuthContext);
if (!value) {
throw new Error("useAuth must be used inside AuthProvider");
}
return value;
}