{"record":{"id":"2149292042e4fbe9","repo":"tinyhumansai/openhuman","slug":"consume-login-token-response-missing-jwt","errorCode":null,"errorMessage":"consume login token response missing jwt","messagePattern":"consume login token response missing jwt","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src/api/rest.rs","lineNumber":538,"sourceCode":"        // (see backend `routes/auth.ts`). The legacy\n        // `telegram/login-tokens/{token}/consume` path-param route was removed, so\n        // the old call 404'd and Telegram/OAuth-token login could never complete\n        // (WIRING_GAPS_AUDIT C1/C2).\n        let response = self\n            .sdk\n            .auth()\n            .consume_login_token(&tinyhumans_sdk::api::types::LoginTokenRequest {\n                token: token.to_string(),\n            })\n            .await\n            .context(\"consume login token through TinyHumans SDK\")?;\n        let jwt = response\n            .get(\"jwt\")\n            .and_then(Value::as_str)\n            .unwrap_or_default()\n            .trim()\n            .to_string();\n        anyhow::ensure!(!jwt.is_empty(), \"consume login token response missing jwt\");\n        Ok(jwt)\n    }\n\n    /// Validates that the provided session token is still active and accepted.\n    pub async fn validate_session_token(&self, bearer_jwt: &str) -> Result<()> {\n        let _ = self.fetch_current_user(bearer_jwt).await?;\n        Ok(())\n    }\n\n    /// Creates a short-lived link token for connecting a specific communication channel.\n    pub async fn create_channel_link_token(\n        &self,\n        channel: &str,\n        bearer_jwt: &str,\n    ) -> Result<Value> {\n        let channel = channel.trim().trim_matches('/');\n        anyhow::ensure!(!channel.is_empty(), \"channel is required\");\n        let encoded_channel = urlencoding::encode(channel);","sourceCodeStart":520,"sourceCodeEnd":556,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/api/rest.rs#L520-L556","documentation":"The backend answered the login-token consume call, but its JSON payload has no non-empty 'jwt' field, so the exchange produced no usable session token and the response is treated as malformed rather than accepted.","triggerScenarios":"Thrown at src/api/rest.rs:538 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check backend logs for why the consume route returned a body without a jwt","Verify the token was not already consumed or expired","Retry with a fresh one-time login token"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"749120085864ce16e0f273c7b86fac7740b39c5b","analyzedAt":"2026-08-17T21:21:45.363Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}