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:
committed by
nitnelave
parent
122e08790f
commit
7707367c35
@@ -7,7 +7,7 @@ authors = ["Valentin Tolmer <valentin@tolmer.fr>"]
|
||||
[dependencies]
|
||||
anyhow = "*"
|
||||
rand = "0.8"
|
||||
requestty = "*"
|
||||
requestty = "0.4.1"
|
||||
serde = "1"
|
||||
serde_json = "1"
|
||||
smallvec = "*"
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user