internal async static void RegisterUserAsync(string username, string authenticationCode) { Validator.ValidateUsername(username); Validator.ValidateAuthCode(authenticationCode); var userModel = new UserModel() { Username = username, AuthCode = authenticationCode }; await HttpRequester.PostAsync<UserModel>(BaseServicesUrl + "users/register", userModel); }
internal async static Task<string> LoginUserAsync(string username, string authenticationCode) { Validator.ValidateUsername(username); Validator.ValidateAuthCode(authenticationCode); var userModel = new UserModel() { Username = username, AuthCode = authenticationCode }; var loginResponse = await HttpRequester.PostAsync<LoginResponseModel>(BaseServicesUrl + "auth/token", userModel); UserId = loginResponse.Id; AccessToken = loginResponse.AccessToken; return loginResponse.Username; }