{"record":{"id":"5342a75cdfe7686f","repo":"BerriAI/litellm","slug":"invalid-verification-code","errorCode":null,"errorMessage":"Invalid verification code","messagePattern":"Invalid verification code","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"litellm/proxy/management_endpoints/ui_sso.py","lineNumber":817,"sourceCode":"    )\n    from litellm.proxy.proxy_server import cli_sso_session_cache\n\n    flow: Final = _get_cli_sso_flow_or_raise(login_id=login_id, cache=cli_sso_session_cache)\n    if not flow.get(\"sso_complete\") or not flow.get(\"session_data\"):\n        raise HTTPException(status_code=400, detail=\"CLI login is not ready\")\n\n    body: Final = (await request.body()).decode(\"utf-8\")\n    form_values: Final = parse_qs(body)\n    supplied_user_code: Final = (form_values.get(\"user_code\") or [\"\"])[0]\n    supplied_browser_complete_token: Final = (form_values.get(\"browser_complete_token\") or [\"\"])[0]\n    supplied_user_code_hash: Final = _hash_cli_sso_secret(_normalize_cli_sso_user_code(supplied_user_code))\n    supplied_browser_complete_token_hash: Final = _hash_cli_sso_secret(supplied_browser_complete_token)\n\n    expected_user_code_hash: Final = flow.get(\"user_code_hash\")\n    if not isinstance(expected_user_code_hash, str) or not secrets.compare_digest(\n        supplied_user_code_hash, expected_user_code_hash\n    ):\n        raise HTTPException(status_code=400, detail=\"Invalid verification code\")\n\n    expected_browser_complete_token_hash: Final = flow.get(\"browser_complete_token_hash\")\n    if not isinstance(expected_browser_complete_token_hash, str) or not secrets.compare_digest(\n        supplied_browser_complete_token_hash, expected_browser_complete_token_hash\n    ):\n        raise HTTPException(status_code=400, detail=\"Invalid verification code\")\n\n    flow[\"user_code_verified\"] = True\n    _set_cli_sso_flow(login_id=login_id, cache=cli_sso_session_cache, flow=flow)\n\n    html_content: Final = render_cli_sso_success_page()\n    return HTMLResponse(content=html_content, status_code=200)\n\n\ndef normalize_email(email: str | None) -> str | None:\n    \"\"\"\n    Normalize email address to lowercase for consistent storage and comparison.\n","sourceCodeStart":799,"sourceCodeEnd":835,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/management_endpoints/ui_sso.py#L799-L835","documentation":"Error \"Invalid verification code\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/proxy/management_endpoints/ui_sso.py:817 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Re-enter the verification code shown in the browser/CLI login flow, or restart the login."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}