mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-27 15:30:56 +00:00
15 lines
269 B
TypeScript
15 lines
269 B
TypeScript
import { useContext } from "react";
|
|
|
|
import { AuthContext } from "./AuthProvider";
|
|
|
|
export const useAuth = () => {
|
|
const context = useContext(AuthContext);
|
|
if (!context) {
|
|
throw new Error("useAuth must be used within AuthProvider");
|
|
}
|
|
|
|
return context;
|
|
};
|
|
|
|
|