File size: 294 Bytes
65d68f5 | 1 2 3 4 5 6 7 8 9 10 11 12 13 | "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;
}
|