mirror of
https://github.com/DrMboga/WotBlitzStatisticsBlazor.git
synced 2026-10-25 03:10:07 +01:00
feat: wg auth prolong prolong method implemented
This commit is contained in:
1 parent
c94a1033c7
commit
ed74321703
4 files changed
+27
-1
No files matched your search
@@ -25,5 +25,17 @@ namespace WotBlitzStatisticsPro.GraphQl.Mutation
|
|||||||
{
|
{
|
||||||
return _wargamingAuthenticationClient.ProlongAuthToken(realm, oldToken);
|
return _wargamingAuthenticationClient.ProlongAuthToken(realm, oldToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Removes player's access token
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="realm">Wargaming realm</param>
|
||||||
|
/// <param name="token">Token to logout</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<string> Logout(RealmType realm, string token)
|
||||||
|
{
|
||||||
|
await _wargamingAuthenticationClient.Logout(realm, token);
|
||||||
|
return "OK";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -8,5 +8,8 @@ namespace WotBlitzStatisticsPro.WgApiClient
|
|||||||
string LoginUrl(RealmType realm);
|
string LoginUrl(RealmType realm);
|
||||||
|
|
||||||
Task<WargamingProlongInfo> ProlongAuthToken(RealmType realm, string oldToken);
|
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);
|
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)
|
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
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user