import { create } from 'zustand'; interface AuthState { /** Whether we've attempted to determine auth status for this page load */ authChecked: boolean; /** Whether the user is currently authenticated (web mode: valid session cookie) */ isAuthenticated: boolean; } interface AuthActions { setAuthState: (state: Partial) => void; resetAuth: () => void; } const initialState: AuthState = { authChecked: false, isAuthenticated: false, }; /** * Web authentication state. * * Intentionally NOT persisted: source of truth is the server session cookie. */ export const useAuthStore = create((set) => ({ ...initialState, setAuthState: (state) => set(state), resetAuth: () => set(initialState), }));