import { createRequire as _createRequire } from 'node:module';
const require = _createRequire(import.meta.url);
import {
  addUserFields
} from "./chunk-HENH75UF.js";
import {
  authenticateWithSiteId
} from "./chunk-YHFCDWGT.js";
import {
  init_esm_shims
} from "./chunk-EXLZF52D.js";

// ../cli-site-old/src/authentication.ts
init_esm_shims();
async function authenticate({
  metaSiteId,
  biLogger,
  errorReporter
}) {
  const authState = await authenticateWithSiteId(
    metaSiteId,
    biLogger,
    errorReporter
  );
  errorReporter.setUser({ id: authState.userInfo.userId });
  addUserFields(biLogger, authState.userInfo.userId);
  return authState;
}

export {
  authenticate
};
//# sourceMappingURL=chunk-PTNF7QD5.js.map