Example #1
0
        internal static bool LogoutUser()
        {
            var headers = new Dictionary <string, string>();

            headers["X-accessToken"] = AccessToken;
            var isLogoutSuccessful = HttpRequester.Put(BaseServicesUrl + "users/logout", headers);

            return(isLogoutSuccessful);
        }
Example #2
0
        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);
        }
Example #3
0
        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);
        }