Removed unstable methods and added missing parameter in auth.get_device_auth_from().

This commit is contained in:
Marta Borgia Leiva 2024-12-18 00:17:14 +01:00
parent b9bc170013
commit 1e35e945b4

View file

@ -132,7 +132,7 @@ impl DeviceCredentials {
_ => { error!("Failed to get device_id!"); }, _ => { error!("Failed to get device_id!"); },
} }
} }
pub fn get_device_auth_from(&mut self, access_token: &str, account_id: &str) { pub fn get_device_auth_from(&mut self, http_client: &Client, access_token: &str, account_id: &str) {
if access_token.is_empty() || account_id.is_empty() { if access_token.is_empty() || account_id.is_empty() {
error!("Device access token cannot be empty!"); error!("Device access token cannot be empty!");
@ -140,7 +140,7 @@ impl DeviceCredentials {
} }
let mut url : String = String::from("https://account-public-service-prod.ol.epicgames.com/account/api/public/account/"); let mut url : String = String::from("https://account-public-service-prod.ol.epicgames.com/account/api/public/account/");
url.push_str(account_id.as_str()); url.push_str(account_id);
url.push_str("/deviceAuth"); url.push_str("/deviceAuth");
/* /*
@ -166,10 +166,10 @@ impl DeviceCredentials {
} }
let mut bearer_header = String::from("Bearer "); let mut bearer_header = String::from("Bearer ");
bearer_header.push_str(access_token.as_str()); bearer_header.push_str(access_token);
let response = Client::post(&http_client, url) let response = Client::post(&http_client, url)
.header("Authorization", bearer_header.as_str()) .header("Authorization", bearer_header)
.send(); .send();
match response { match response {