From db4317c2f410d8a7cbf4a18f061b3833adee2e31 Mon Sep 17 00:00:00 2001 From: Enzo Innocenzi Date: Wed, 12 Sep 2018 15:49:35 +0200 Subject: [PATCH] Fixed error caused by new authentication response --- MojangSharp/Endpoints/Authentication.cs | 4 ++-- Sample/Program.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/MojangSharp/Endpoints/Authentication.cs b/MojangSharp/Endpoints/Authentication.cs index bd5328d..6be7f24 100644 --- a/MojangSharp/Endpoints/Authentication.cs +++ b/MojangSharp/Endpoints/Authentication.cs @@ -68,7 +68,7 @@ public async override Task PerformRequestAsync() { PlayerName = profile["name"].ToObject(), Value = profile["id"].ToObject(), - Legacy = (profile.ToString().Contains("legacy") ? profile["legacy"].ToObject() : false), + Legacy = (profile.ToString().Contains("legacyProfile") ? profile["legacyProfile"].ToObject() : false), Demo = null }); @@ -81,7 +81,7 @@ public async override Task PerformRequestAsync() { PlayerName = user["selectedProfile"]["name"].ToObject(), Value = user["selectedProfile"]["id"].ToObject(), - Legacy = (user["selectedProfile"].ToString().Contains("legacy") ? user["selectedProfile"]["legacy"].ToObject() : false), + Legacy = (user["selectedProfile"].ToString().Contains("legacyProfile") ? user["selectedProfile"]["legacyProfile"].ToObject() : false), Demo = null }, User = user["user"].ToObject() diff --git a/Sample/Program.cs b/Sample/Program.cs index 1345fce..fbbc341 100644 --- a/Sample/Program.cs +++ b/Sample/Program.cs @@ -38,7 +38,7 @@ private void PerformTests() // Authentication WriteColoredLine(ConsoleColor.DarkCyan, "\n[Post] Authenticate"); - string u = "@.com", p = ""; + string u = "@.com", p = ""; AuthenticateResponse auth = new Authenticate(new Credentials() { Username = u, Password = p }).PerformRequestAsync().Result; if (auth.IsSuccess) {