diff --git a/DuolingoNET/Duolingo.cs b/DuolingoNET/Duolingo.cs
index 540e5d7..ec62da7 100644
--- a/DuolingoNET/Duolingo.cs
+++ b/DuolingoNET/Duolingo.cs
@@ -38,12 +38,12 @@ public class Duolingo
#region Properties
///
- /// A string representing the username or email of the account.
+ /// A string representing the username or email of the account used for login.
///
public string LoginUsername { get; set; }
///
- /// A string representing the password of the account.
+ /// A string representing the password of the account used for login.
///
public string LoginPassword { get; set; }
@@ -52,6 +52,11 @@ public class Duolingo
///
public HttpClient Client { get; set; }
+ ///
+ /// The containing the login data of the user.
+ ///
+ public LoginData LoginData { get; set; }
+
///
/// The containing the data of the user.
///
@@ -155,7 +160,7 @@ public async Task GetVocabularyAsync()
public async Task GetUserDataAsync()
{
// Gets the user data using the username extracted from the login data
- var getUserDataResult = await Client.GetAsync(string.Format("/users/{0}", User.Username));
+ var getUserDataResult = await Client.GetAsync(string.Format("/users/{0}", LoginData.Username));
getUserDataResult.EnsureSuccessStatusCode();
var json = await getUserDataResult.Content.ReadAsStringAsync();
@@ -203,7 +208,7 @@ private async Task LoginAsync()
loginResult.EnsureSuccessStatusCode();
// Reads the username on the website
- User = JsonConvert.DeserializeObject(await loginResult.Content.ReadAsStringAsync());
+ LoginData = JsonConvert.DeserializeObject(await loginResult.Content.ReadAsStringAsync());
}
///
diff --git a/DuolingoNET/LoginData.cs b/DuolingoNET/LoginData.cs
new file mode 100644
index 0000000..b58de20
--- /dev/null
+++ b/DuolingoNET/LoginData.cs
@@ -0,0 +1,35 @@
+using Newtonsoft.Json;
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace DuolingoNET
+{
+ ///
+ /// The login class.
+ /// Contains the login data returned from the website for the logged in user.
+ ///
+ ///
+ /// -
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public class LoginData
+ {
+ ///
+ /// A string representing the username of the account.
+ ///
+ [JsonProperty("username")]
+ public string Username { get; set; }
+
+ ///
+ /// A string representing the Id of the account.
+ ///
+ [JsonProperty("user_id")]
+ public string UserId { get; set; }
+ }
+}