feat: wg auth prolong prolong method implemented

This commit is contained in:
Michael Shabanov committed 2021-10-20 11:51:58 +03:00
1 parent c94a1033c7
commit ed74321703
4 files changed
+27 -1

No files matched your search

@@ -8,5 +8,8 @@ namespace WotBlitzStatisticsPro.WgApiClient
string LoginUrl(RealmType realm);
Task<WargamingProlongInfo> ProlongAuthToken(RealmType realm, string oldToken);
Task Logout(RealmType realm, string token);
}
}
@@ -75,7 +75,7 @@ namespace WotBlitzStatisticsPro.WgApiClient
var responseBody = JsonConvert.DeserializeObject<ResponseBody<T>>(responseString);
_logger.LogInformation($"HTTP GET {uri} - {responseBody.Status}");
_logger.LogInformation($"HTTP {(postMethod ? "POST": "GET")} {uri} - {responseBody.Status}");
switch (responseBody.Status)
{
@@ -232,6 +232,17 @@ namespace WotBlitzStatisticsPro.WgApiClient
};
}
public async Task Logout(RealmType realm, string token)
{
// https://api.worldoftanks.ru/wot/auth/logout/?application_id=adc1387489cf9fc8d9a1d85dbd27763d
string prolongUri = GetWotUri(
realm,
"auth/logout/",
new string[] { $"access_token={token}" });
await CallWgApi<WotAuthProlongateResponse>(prolongUri, true);
}
#endregion
}
}