Skip to content

Commit

Permalink
Merge pull request #1150 from thailyn/fix-login-2022
Browse files Browse the repository at this point in the history
Use the new API endpoint to get the account name.
  • Loading branch information
thailyn authored Dec 22, 2022
2 parents 718cb31 + 444ca46 commit 7e50b12
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
8 changes: 7 additions & 1 deletion POEApi.Model/JSONProxy/Account.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
namespace POEApi.Model.JSONProxy
{
// Represents a pathofexile.com account; should match what is defined at
// https://www.pathofexile.com/developer/docs/reference#profile .
public class Account
{
public string AccountName { get; set; }
public string uuid { get; set; }
public string name { get; set; }
public string realm { get; set; }

// TODO: Add objects for guild and twitch information.
}
}
4 changes: 2 additions & 2 deletions POEApi.Model/POEModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,12 @@ public string GetAccountName(string realm)

var account = GetProperObjectFromTransport<Account>(Transport.GetAccountName(realm));

if (string.IsNullOrEmpty(account?.AccountName))
if (string.IsNullOrEmpty(account?.name))
{
throw new Exception("Null account name received from API");
}

return account.AccountName;
return account.name;
}
catch (Exception ex)
{
Expand Down
2 changes: 1 addition & 1 deletion POEApi.Transport/HttpTransport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ protected enum HttpMethod { GET, POST }

private const string LoginURL = @"https://www.pathofexile.com/#";
private const string AccountURL = @"https://www.pathofexile.com/my-account";
private const string AccountNameURL = @"https://www.pathofexile.com/character-window/get-account-name?realm={0}";
private const string AccountNameURL = @"https://api.pathofexile.com/profile";
private const string CharacterURL = @"https://www.pathofexile.com/character-window/get-characters?&realm={0}";
private const string StashURL = @"https://www.pathofexile.com/character-window/get-stash-items?league={0}&tabs=1&tabIndex={1}&accountName={2}&realm={3}";
private const string InventoryURL = @"https://www.pathofexile.com/character-window/get-items?character={0}&accountName={1}&realm={2}";
Expand Down

0 comments on commit 7e50b12

Please # to comment.