forked from proxmox-mirrors/proxmox
proxmox-login: pass body as &str to response()
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
This commit is contained in:
parent
be169e25ae
commit
a41c8481e2
@ -265,8 +265,8 @@ impl SecondFactorChallenge {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Deal with the API's response object to extract the ticket.
|
/// Deal with the API's response object to extract the ticket.
|
||||||
pub fn response(&self, body: &[u8]) -> Result<Authentication, ResponseError> {
|
pub fn response(&self, body: &str) -> Result<Authentication, ResponseError> {
|
||||||
let response: api::ApiResponse<api::CreateTicketResponse> = serde_json::from_slice(body)?;
|
let response: api::ApiResponse<api::CreateTicketResponse> = serde_json::from_str(body)?;
|
||||||
let response = response.data.ok_or("missing response data")?;
|
let response = response.data.ok_or("missing response data")?;
|
||||||
|
|
||||||
if response.username != self.userid {
|
if response.username != self.userid {
|
||||||
|
Loading…
Reference in New Issue
Block a user