{"record":{"id":"a0a826b058d74804","repo":"atuinsh/atuin","slug":"your-hub-session-token-is-invalid-please-run-atu","errorCode":null,"errorMessage":"Your Hub session token is invalid. Please run 'atuin login' to re-authenticate with Atuin Hub.","messagePattern":"Your Hub session token is invalid\\. Please run 'atuin login' to re-authenticate with Atuin Hub\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/atuin-client/src/auth.rs","lineNumber":367,"sourceCode":"        if let Ok(err) = resp.json::<HubErrorResponse>().await {\n            bail!(\"{}\", err.reason);\n        }\n\n        bail!(\"Hub registration failed with status {status}\");\n    }\n\n    async fn change_password(\n        &self,\n        current_password: &str,\n        new_password: &str,\n        totp_code: Option<&str>,\n    ) -> Result<MutateResponse> {\n        let hub_token = self.hub_token.as_deref().ok_or_else(|| {\n            eyre::eyre!(\"Not logged in to Atuin Hub. Please run 'atuin login' to authenticate.\")\n        })?;\n\n        if !hub_token.starts_with(\"atapi_\") {\n            bail!(\n                \"Your Hub session token is invalid. Please run 'atuin login' to re-authenticate \\\n                 with Atuin Hub.\"\n            );\n        }\n\n        let url = self.address.append_path(\"api/v0/account/password\")?;\n        let client = reqwest::Client::new();\n\n        let mut body = serde_json::json!({\n            \"current_password\": current_password,\n            \"new_password\": new_password,\n        });\n        if let Some(code) = totp_code {\n            body[\"totp_code\"] = serde_json::Value::String(code.to_string());\n        }\n\n        let resp = client\n            .patch(url)","sourceCodeStart":349,"sourceCodeEnd":385,"githubUrl":"https://github.com/atuinsh/atuin/blob/c0c717ab04c881764bcad4b3d169a507e2432643/crates/atuin-client/src/auth.rs#L349-L385","documentation":"Hard guard at the top of the auth-module change_password: no Hub token is present in local config, so no authenticated password-change request can even be attempted. This is a local preconditions check — the user has never completed Hub login on this machine.","triggerScenarios":"Thrown at crates/atuin-client/src/auth.rs:367 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Run 'atuin login' to authenticate and obtain a Hub session/token","Verify the config file storing the Hub token exists and is readable"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"c0c717ab04c881764bcad4b3d169a507e2432643","analyzedAt":"2026-09-12T07:40:01.341Z","contentChangedAt":"2026-09-12T07:40:01.341Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}