Ejemplo n.º 1
0
        public static void GetCsrfToken()
        {
            var     tokenQuery  = IlluminaHash.GetUniqueDateTimeHash();
            var     uri         = NetworkManager.App_Url + "/" + tokenQuery + "/token";
            Request csrfRequest = new Request {
                uri = uri,
            };

            csrfRequest.RequestSuccessEvents += SetCsrfToken;
            csrfRequest.RequestFailedEvents  += DisplayAlert;
            Get(csrfRequest);
        }
        public static void VerifyEmail(User user)
        {
            user.password = IlluminaHash.GetHash(user.password);
            Request verifyRequest = new Request {
                uri  = NetworkManager.App_Url + "/user/verifyemail/" + IlluminaHash.GetUniqueDateTimeHash(),
                body = user
            };

            verifyRequest.RequestSuccessEvents += OnVerifyRequestSuccess;
            verifyRequest.RequestFailedEvents  += OnVerifyRequestFailed;
            Store <User>(verifyRequest);
        }
        public static void Login(User user)
        {
            user.password = IlluminaHash.GetHash(user.password);
            //user.username = IlluminaCipher.Encipher(user.username);
            Request loginRequest = new Request {
                uri  = NetworkManager.App_Url + "/user/login",
                body = user
            };

            loginRequest.RequestSuccessEvents += OnLoginRequestSuccess;
            loginRequest.RequestFailedEvents  += OnLoginRequestFailed;
            Update <User>(loginRequest);
        }
        public static void Signup(User user)
        {
            password      = user.password;
            user.password = IlluminaHash.GetHash(user.password);
            Request signupRequest = new Request {
                uri  = NetworkManager.App_Url + "/user",
                body = user
            };

            signupRequest.RequestSuccessEvents += OnSignUpRequestSuccess;
            signupRequest.RequestFailedEvents  += OnSignUpRequestFailed;
            Store <User>(signupRequest);
        }
        public static void UserExists(string identifier, string value, RequestSuccessEventHandler e, RequestFailedEventHandler f)
        {
            var tokenQuery = IlluminaHash.GetUniqueDateTimeHash();
            var uri        = NetworkManager.App_Url + "/user/exists/" + tokenQuery;

            uri += "?" + identifier + "=" + value;
            Request userExistRequest = new Request {
                uri = uri,
            };

            userExistRequest.RequestSuccessEvents += e;
            userExistRequest.RequestFailedEvents  += f;
            IlluminaWebRequest.Get(userExistRequest);
        }