(daemonBaseUrl: string, env: EnvMap)
| 524 | } |
| 525 | |
| 526 | function 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 | |
| 537 | function appendUserCode(verificationUri: string, userCode: string): string { |
| 538 | const url = new URL(verificationUri); |
no test coverage detected