Example #1
0
 public bool CheckUserPassword(RegistrationModel registrationModel, string BaseUrl, string action, out string ErrorMessage, out CustomExceptionRAC customException)
 {
     customException = null;
     ErrorMessage    = string.Empty;
     if (!string.IsNullOrWhiteSpace(registrationModel.Username) && !string.IsNullOrWhiteSpace(registrationModel.Password))
     {
         UserRACRequest user = new UserRACRequest {
             email = registrationModel.Username, password = registrationModel.Password
         };
         UserRACResponse userResponse = new UserRACResponse();
         if (Registration.CheckNet())
         {
             userResponse = Registration.HttpClientRAC <UserRACRequest, UserRACResponse>(user, BaseUrl, action, out customException);
             if (userResponse != null && !string.IsNullOrEmpty(userResponse.token))
             {
                 return(true);
             }
             else
             {
                 return(false);
             }
         }
         else
         {
             ErrorMessage = "Internet is not available";
             return(true);
         }
     }
     else
     {
         return(false);
     }
 }
Example #2
0
        public UserRACResponse UserLoginJCHAuth(UserRACRequest user, out string ErrorMessage, out CustomExceptionRAC customException)
        {
            customException = null;
            ErrorMessage    = string.Empty;
            UserRACResponse userResponse = new UserRACResponse();

            if (Registration.CheckNet())
            {
                string RACBaseUrl   = ConfigurationManager.AppSettings["RACBaseUrl"];
                string RACSignInUrl = "auth/sign-in";
                userResponse = Registration.HttpClientRAC <UserRACRequest, UserRACResponse>(user, RACBaseUrl, RACSignInUrl, out customException);
                if (customException != null)
                {
                    return(null);
                }
            }
            else
            {
                ErrorMessage = "Internet is not available";
            }
            return(userResponse);
        }