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

Function shouldUseCloudAuth

src/cli/auth-session.ts:526–535  ·  view source on GitHub ↗
(daemonBaseUrl: string, env: EnvMap)

Source from the content-addressed store, hash-verified

524}
525
526function shouldUseCloudAuth(daemonBaseUrl: string, env: EnvMap): boolean {
527 if (env.AGENT_DEVICE_CLOUD_AUTH === '1' || env.AGENT_DEVICE_CLOUD_AUTH === 'true') return true;
528 if (hasToken(env.AGENT_DEVICE_CLOUD_BASE_URL)) return true;
529 try {
530 const hostname = new URL(daemonBaseUrl).hostname.toLowerCase();
531 return hostname === 'agent-device.dev' || hostname.endsWith('.agent-device.dev');
532 } catch {
533 return false;
534 }
535}
536
537function appendUserCode(verificationUri: string, userCode: string): string {
538 const url = new URL(verificationUri);

Callers 1

resolveRemoteAuthFunction · 0.85

Calls 1

hasTokenFunction · 0.85

Tested by

no test coverage detected