Files
gunbuilder-next-tailwind/src/store/useAuthStore.ts
T
2025-06-30 06:36:03 -04:00

16 lines
432 B
TypeScript

import { create } from 'zustand';
import { Session } from 'next-auth';
interface AuthStore {
session: Session | null;
isLoading: boolean;
setSession: (session: Session | null) => void;
setLoading: (isLoading: boolean) => void;
}
export const useAuthStore = create<AuthStore>((set) => ({
session: null,
isLoading: true,
setSession: (session) => set({ session }),
setLoading: (isLoading) => set({ isLoading }),
}));