mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
validates with saved clienttoken
This commit is contained in:
parent
2861be757f
commit
7230cd726b
1 changed files with 3 additions and 2 deletions
|
|
@ -221,14 +221,15 @@ namespace MinecraftClient.Protocol
|
||||||
/// Validates whether accessToken must be refreshed
|
/// Validates whether accessToken must be refreshed
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="accesstoken">Will contain the cached access token previously returned by Minecraft.net</param>
|
/// <param name="accesstoken">Will contain the cached access token previously returned by Minecraft.net</param>
|
||||||
|
/// <param name="clienttoken">Will contain the cached client token created on login</param>
|
||||||
/// <returns>Returns the status of the token (Valid, Invalid, etc.)</returns>
|
/// <returns>Returns the status of the token (Valid, Invalid, etc.)</returns>
|
||||||
///
|
///
|
||||||
public static ValidationResult GetTokenValidation(string accesstoken)
|
public static ValidationResult GetTokenValidation(string accesstoken, string clienttoken)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
string result = "";
|
string result = "";
|
||||||
string json_request = "{\"accessToken\": \"" + jsonEncode(accesstoken) + "\" }";
|
string json_request = "{\"accessToken\": \"" + jsonEncode(accesstoken) + "\", \"clientToken\": \"" + jsonEncode(clienttoken) + "\" }";
|
||||||
int code = doHTTPSPost("authserver.mojang.com", "/validate", json_request, ref result);
|
int code = doHTTPSPost("authserver.mojang.com", "/validate", json_request, ref result);
|
||||||
if (code == 204)
|
if (code == 204)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue