{"record":{"id":"6914497916d98cd8","repo":"diegosouzapw/OmniRoute","slug":"device-disabled","errorCode":"device_disabled","errorMessage":"Device code login is not enabled for this account. Enable it in ChatGPT security settings (or ask your workspace admin), or use the localhost 'Adicionar' flow.","messagePattern":"Device code login is not enabled for this account\\. Enable it in ChatGPT security settings \\(or ask your workspace admin\\), or use the localhost 'Adicionar' flow\\.","errorType":"exception","errorClass":"CodexDeviceFlowError","httpStatus":404,"severity":"error","filePath":"src/lib/oauth/codexDeviceFlow.ts","lineNumber":150,"sourceCode":"export async function requestUserCode(\n  clientId: string = DEFAULT_CLIENT_ID,\n  signal?: AbortSignal\n): Promise<CodexUserCode> {\n  let res: Response;\n  try {\n    res = await fetch(`${API_BASE_URL}/deviceauth/usercode`, {\n      method: \"POST\",\n      headers: { \"Content-Type\": \"application/json\", Accept: \"application/json\" },\n      body: JSON.stringify({ client_id: clientId }),\n      signal,\n    });\n  } catch (e: any) {\n    if (e?.name === \"AbortError\") throw new CodexDeviceFlowError(\"aborted\", \"Device flow aborted\");\n    throw new CodexDeviceFlowError(\"network\", `Failed to reach OpenAI: ${e?.message || e}`);\n  }\n\n  if (res.status === 404) {\n    throw new CodexDeviceFlowError(\n      \"device_disabled\",\n      \"Device code login is not enabled for this account. Enable it in ChatGPT security settings (or ask your workspace admin), or use the localhost 'Adicionar' flow.\",\n      404\n    );\n  }\n\n  if (!res.ok) {\n    const text = await res.text().catch(() => \"\");\n    throw new CodexDeviceFlowError(\n      \"usercode_failed\",\n      `Failed to request device code (${res.status}): ${text}`,\n      res.status\n    );\n  }\n\n  const data: any = await res.json();\n  const userCode = data.user_code || data.usercode;\n  if (!data.device_auth_id || !userCode) {","sourceCodeStart":132,"sourceCodeEnd":168,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/lib/oauth/codexDeviceFlow.ts#L132-L168","documentation":"Error \"Device code login is not enabled for this account. Enable it in ChatGPT security settings (or ask your workspace admin), or use the localhost 'Adicionar' flow.\" thrown in diegosouzapw/OmniRoute.","triggerScenarios":"Thrown at src/lib/oauth/codexDeviceFlow.ts:150 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"}