import { bv as useUserSession } from './server.mjs';
import { computed } from 'vue';

const useAuth = () => {
  const { user } = useUserSession();
  const isAdmin = computed(() => user.value?.role === "admin");
  const isEditorOrAdmin = computed(() => user.value?.role === "admin" || user.value?.role === "editor");
  return {
    isAdmin,
    isEditorOrAdmin
  };
};

export { useAuth as u };
