Skip to content

#1 PDF Application on GitHub that lets you edit PDFs on any device anywhere

404 B
Raw Blame
import { useAuth } from "@editor/auth/UseSession";

/** Cache scope for a confirmed local admin; null prevents requests, including login-off sessions. */
export function useFleetStatsAccess(): string | null {
  const auth = useAuth();
  if (
    auth.loading ||
    auth.error ||
    !auth.session ||
    auth.isAnonymous ||
    !auth.isAdmin
  ) {
    return null;
  }
  return auth.user?.id ?? null;
}