Skip to content
This repository has been archived by the owner on Jan 20, 2020. It is now read-only.

Commit

Permalink
Fixed error caused by new authentication response
Browse files Browse the repository at this point in the history
  • Loading branch information
Enzo Innocenzi committed Sep 12, 2018
1 parent 08b4e79 commit db4317c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions MojangSharp/Endpoints/Authentication.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public async override Task<AuthenticateResponse> PerformRequestAsync()
{
PlayerName = profile["name"].ToObject<string>(),
Value = profile["id"].ToObject<string>(),
Legacy = (profile.ToString().Contains("legacy") ? profile["legacy"].ToObject<bool>() : false),
Legacy = (profile.ToString().Contains("legacyProfile") ? profile["legacyProfile"].ToObject<bool>() : false),
Demo = null
});

Expand All @@ -81,7 +81,7 @@ public async override Task<AuthenticateResponse> PerformRequestAsync()
{
PlayerName = user["selectedProfile"]["name"].ToObject<string>(),
Value = user["selectedProfile"]["id"].ToObject<string>(),
Legacy = (user["selectedProfile"].ToString().Contains("legacy") ? user["selectedProfile"]["legacy"].ToObject<bool>() : false),
Legacy = (user["selectedProfile"].ToString().Contains("legacyProfile") ? user["selectedProfile"]["legacyProfile"].ToObject<bool>() : false),
Demo = null
},
User = user["user"].ToObject<UserData>()
Expand Down
2 changes: 1 addition & 1 deletion Sample/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ private void PerformTests()

// Authentication
WriteColoredLine(ConsoleColor.DarkCyan, "\n[Post] Authenticate");
string u = "<name>@<provider>.com", p = "<password>";
string u = "<mail>@<provider>.com", p = "<password>";
AuthenticateResponse auth = new Authenticate(new Credentials() { Username = u, Password = p }).PerformRequestAsync().Result;
if (auth.IsSuccess)
{
Expand Down

0 comments on commit db4317c

Please sign in to comment.