mirror of
https://github.com/ForFarmTeam/ForFarm.git
synced 2025-12-19 05:54:08 +01:00
13 lines
294 B
TypeScript
13 lines
294 B
TypeScript
"use client";
|
|
|
|
import { SessionContext } from "next-auth/react";
|
|
import { useContext } from "react";
|
|
|
|
export function useSession() {
|
|
const context = useContext(SessionContext);
|
|
if (!context) {
|
|
throw new Error("useSession must be used within a SessionProvider");
|
|
}
|
|
return context;
|
|
}
|