internal static bool LogoutUser() { var headers = new Dictionary <string, string>(); headers["X-accessToken"] = AccessToken; var isLogoutSuccessful = HttpRequester.Put(BaseServicesUrl + "users/logout", headers); return(isLogoutSuccessful); }
internal static string LoginUser(string username, string authenticationCode) { //Validation!!!!! //validate username //validate email //validate authentication code //use validation from WebAPI var userModel = new UserModel() { Username = username, AuthCode = authenticationCode }; var loginResponse = HttpRequester.Post <LoginResponseModel>(BaseServicesUrl + "auth/token", userModel); AccessToken = loginResponse.AccessToken; return(loginResponse.Username); }
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 }; HttpRequester.Post(BaseServicesUrl + "users/register", userModel); }