diff --git a/Xenon/Accounts/Account.cs b/Xenon/Accounts/Account.cs index 3df73b3..0e3d268 100644 --- a/Xenon/Accounts/Account.cs +++ b/Xenon/Accounts/Account.cs @@ -12,7 +12,7 @@ namespace Xenon.Accounts public class Account : INotifyPropertyChanged { private string _username; - private string _password; + private string _token; private string _friendlyName = null; [JsonProperty("username")] @@ -27,12 +27,12 @@ public string Username } [JsonProperty("token")] - public string Password + public string Token { - get { return _password; } + get { return _token; } set { - _password = value; + _token = value; NotifyPropertyChanged(); } } @@ -53,13 +53,14 @@ public string FriendlyName public string DisplayName => (_friendlyName != null) ? _friendlyName : _username; - public Account(string username, string password, string friendlyName = null, bool passwordAlreadyHashed = false) + public Account() { } + public Account(string username, string passwordOrToken, string friendlyName = null, bool isToken = false) { this.Username = username; - this.Password = - passwordAlreadyHashed - ? password - : Nexon.Auth.HashHexPassword(password); + this.Token = + isToken + ? passwordOrToken + : Nexon.Auth.HashHexPassword(passwordOrToken); this.FriendlyName = friendlyName; } diff --git a/Xenon/Accounts/Manager.xaml.cs b/Xenon/Accounts/Manager.xaml.cs index ac9e372..0e8b18e 100644 --- a/Xenon/Accounts/Manager.xaml.cs +++ b/Xenon/Accounts/Manager.xaml.cs @@ -33,6 +33,7 @@ public Manager(MainWindow mw) _mw = mw; List _accounts = JsonConvert.DeserializeObject>(Properties.Settings.Default.savedAccounts); + accounts = new ObservableCollection(_accounts); listBox.ItemsSource = accounts; diff --git a/Xenon/Nexon/Auth.cs b/Xenon/Nexon/Auth.cs index c844cb4..5832412 100644 --- a/Xenon/Nexon/Auth.cs +++ b/Xenon/Nexon/Auth.cs @@ -66,7 +66,7 @@ public static async Task Login(Accounts.Account account) { RequestUri = new Uri("https://accounts.nexon.net/account/login/launcher"), Method = HttpMethod.Post, - Content = new StringContent($"{{\"id\":\"{account.Username}\",\"password\":\"{account.Password}\",\"auto_login\":false,\"client_id\":\"{CLIENT_ID}\",\"scope\":\"{SCOPE}\",\"device_id\":\"{DeviceId}\"}}", Encoding.UTF8, "application/json") + Content = new StringContent($"{{\"id\":\"{account.Username}\",\"password\":\"{account.Token}\",\"auto_login\":false,\"client_id\":\"{CLIENT_ID}\",\"scope\":\"{SCOPE}\",\"device_id\":\"{DeviceId}\"}}", Encoding.UTF8, "application/json") }; req.Headers.Add("User-Agent", "NexonLauncher node-webkit/0.14.6 (Windows NT 10.0; WOW64) WebKit/537.36 (@c26c0312e940221c424c2730ef72be2c69ac1b67) nexon_client");