internal static void RegisterUser(string username, string email, string authenticationCode) { //Validation!!!!! //validate username //validate email //validate authentication code //use validation from WebAPI var userModel = new UserModel() { Username = username, Email = email, AuthCode = authenticationCode }; var httpRequester = new HttpRequester(BaseServicesUrl); var response = httpRequester.Post <UserModel>("users/register", userModel); }
internal static string LoginUser(string username, string authenticationCode) { //Validation!!!!! //validate username //validate authentication code //use validation from WebAPI var userModel = new UserModel() { Username = username, AuthCode = authenticationCode }; var httpRequester = new HttpRequester(BaseServicesUrl); var loginResponse = httpRequester .Post <LoginResponseModel>("auth/token", userModel); AccessToken = loginResponse.AccessToken; return(loginResponse.Username); }