diff --git a/proxmox-login/src/lib.rs b/proxmox-login/src/lib.rs index e03cd366..a08fb823 100644 --- a/proxmox-login/src/lib.rs +++ b/proxmox-login/src/lib.rs @@ -265,8 +265,8 @@ impl SecondFactorChallenge { } /// Deal with the API's response object to extract the ticket. - pub fn response(&self, body: &[u8]) -> Result { - let response: api::ApiResponse = serde_json::from_slice(body)?; + pub fn response(&self, body: &str) -> Result { + let response: api::ApiResponse = serde_json::from_str(body)?; let response = response.data.ok_or("missing response data")?; if response.username != self.userid {