migration-tool: Extract the JWT from the JSON response

The response used to contain just the JWT, but now it's wrapped in JSON.

Fixes #282.
This commit is contained in:
Valentin Tolmer
2022-08-03 21:28:45 +02:00
committed by nitnelave
parent 122e08790f
commit 7707367c35
3 changed files with 8 additions and 6 deletions

View File

@@ -174,7 +174,9 @@ fn try_login(
response.status().as_str()
);
}
Ok(response.text()?)
let json = serde_json::from_str::<lldap_auth::login::ServerLoginResponse>(&response.text()?)
.context("Could not parse response")?;
Ok(json.token)
}
pub fn get_lldap_user_and_password(