mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2025-05-15 16:13:55 +00:00
Update to use the make_http_request
This commit is contained in:
parent
fd00f3ed1d
commit
256f87a1aa
1 changed files with 3 additions and 5 deletions
|
@ -14,7 +14,7 @@ use crate::{
|
||||||
DbConn, DbPool,
|
DbConn, DbPool,
|
||||||
},
|
},
|
||||||
error::Error,
|
error::Error,
|
||||||
util::get_reqwest_client,
|
http_client::make_http_request,
|
||||||
CONFIG,
|
CONFIG,
|
||||||
};
|
};
|
||||||
use url::Url;
|
use url::Url;
|
||||||
|
@ -186,8 +186,7 @@ impl DuoClient {
|
||||||
post_body.insert("client_assertion", token);
|
post_body.insert("client_assertion", token);
|
||||||
post_body.insert("client_id", self.client_id.clone());
|
post_body.insert("client_id", self.client_id.clone());
|
||||||
|
|
||||||
let res = match get_reqwest_client()
|
let res = match make_http_request(reqwest::Method::POST, &health_check_url)?
|
||||||
.post(health_check_url)
|
|
||||||
.header(header::USER_AGENT, "vaultwarden:Duo/2.0 (Rust)")
|
.header(header::USER_AGENT, "vaultwarden:Duo/2.0 (Rust)")
|
||||||
.form(&post_body)
|
.form(&post_body)
|
||||||
.send()
|
.send()
|
||||||
|
@ -293,8 +292,7 @@ impl DuoClient {
|
||||||
.insert("client_assertion_type", String::from("urn:ietf:params:oauth:client-assertion-type:jwt-bearer"));
|
.insert("client_assertion_type", String::from("urn:ietf:params:oauth:client-assertion-type:jwt-bearer"));
|
||||||
post_body.insert("client_assertion", token);
|
post_body.insert("client_assertion", token);
|
||||||
|
|
||||||
let res = match get_reqwest_client()
|
let res = match make_http_request(reqwest::Method::POST, &token_url)?
|
||||||
.post(&token_url)
|
|
||||||
.header(header::USER_AGENT, "vaultwarden:Duo/2.0 (Rust)")
|
.header(header::USER_AGENT, "vaultwarden:Duo/2.0 (Rust)")
|
||||||
.form(&post_body)
|
.form(&post_body)
|
||||||
.send()
|
.send()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue