{"record":{"id":"0db26ed0f12be3b8","repo":"diegosouzapw/OmniRoute","slug":"device-authorization-failed-error","errorCode":null,"errorMessage":"Device authorization failed: ${error}","messagePattern":"Device authorization failed: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/lib/oauth/providers/kiro.ts","lineNumber":65,"sourceCode":"    const clientInfo = await registerRes.json();\n\n    // Step 2: Request device authorization\n    const deviceRes = await fetch(config.deviceAuthUrl, {\n      method: \"POST\",\n      headers: {\n        \"Content-Type\": \"application/json\",\n        Accept: \"application/json\",\n      },\n      body: JSON.stringify({\n        clientId: clientInfo.clientId,\n        clientSecret: clientInfo.clientSecret,\n        startUrl: config.startUrl,\n      }),\n    });\n\n    if (!deviceRes.ok) {\n      const error = await deviceRes.text();\n      throw new Error(`Device authorization failed: ${error}`);\n    }\n\n    const deviceData = await deviceRes.json();\n\n    return {\n      device_code: deviceData.deviceCode,\n      user_code: deviceData.userCode,\n      verification_uri: deviceData.verificationUri,\n      verification_uri_complete: deviceData.verificationUriComplete,\n      expires_in: deviceData.expiresIn,\n      interval: deviceData.interval || 5,\n      _clientId: clientInfo.clientId,\n      _clientSecret: clientInfo.clientSecret,\n      _region: resolvedRegion,\n      _authMethod: config.skipIssuerUrlForRegistration ? \"idc\" : \"builder-id\",\n    };\n  },\n  pollToken: async (config, deviceCode, codeVerifier, extraData) => {","sourceCodeStart":47,"sourceCodeEnd":83,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/lib/oauth/providers/kiro.ts#L47-L83","documentation":"Error \"Device authorization failed: ${error}\" thrown in diegosouzapw/OmniRoute.","triggerScenarios":"Thrown at src/lib/oauth/providers/kiro.ts:65 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d","analyzedAt":"2026-08-25T18:35:09.898Z","schemaVersion":2},"datasetVersion":"2026-08-25T21:54:21.419Z"}