first
This commit is contained in:
commit
8538ab969a
434 changed files with 44051 additions and 0 deletions
12
apps/web/modules/saas/auth/hooks/use-session.ts
Normal file
12
apps/web/modules/saas/auth/hooks/use-session.ts
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
import { useContext } from "react";
|
||||
import { SessionContext } from "../lib/session-context";
|
||||
|
||||
export const useSession = () => {
|
||||
const sessionContext = useContext(SessionContext);
|
||||
|
||||
if (sessionContext === undefined) {
|
||||
throw new Error("useSession must be used within SessionProvider");
|
||||
}
|
||||
|
||||
return sessionContext;
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue