MCPcopy Index your code
hub / github.com/callstack/agent-device / buildNonInteractiveLoginError

Function buildNonInteractiveLoginError

src/cli/auth-session.ts:499–510  ·  view source on GitHub ↗
(command: string, env: EnvMap)

Source from the content-addressed store, hash-verified

497}
498
499function buildNonInteractiveLoginError(command: string, env: EnvMap): AppError {
500 const cloudBaseUrl = resolveCloudBaseUrl(env);
501 return new AppError(
502 'UNAUTHORIZED',
503 `${command} cannot perform interactive login in CI or a non-interactive shell.`,
504 {
505 hint:
506 `Create a service/API token: ${new URL(API_KEYS_PATH, cloudBaseUrl).toString()} ` +
507 'Then set AGENT_DEVICE_DAEMON_AUTH_TOKEN=adc_live_...',
508 },
509 );
510}
511
512function resolveCloudBaseUrl(env: EnvMap, fallback?: string): string {
513 const raw = env.AGENT_DEVICE_CLOUD_BASE_URL ?? fallback ?? DEFAULT_CLOUD_BASE_URL;

Callers 2

resolveRemoteAuthFunction · 0.85
loginWithDeviceAuthFunction · 0.85

Calls 1

resolveCloudBaseUrlFunction · 0.85

Tested by

no test coverage detected