Пример #1
0
        public ActionResult OTP4PhoneVerification(int UserId, string phoneNumber, bool displayError = false)
        {
            VerifyOTPPhoneViewModel model = new VerifyOTPPhoneViewModel();

            model.UserId      = UserId;
            model.PhoneNumber = phoneNumber;
            model.Provider    = "Phone Code";

            if (displayError)
            {
                AddErrors(new IdentityResult(string.Format(RBAC_ExtendedMethods.c_AccountPhoneNumberUnconfirmed, phoneNumber)));
            }

            return(View(model));
        }
Пример #2
0
        public ActionResult OTP4PhoneVerification(VerifyOTPPhoneViewModel model)
        {
            if (!ModelState.IsValid)
            {
                return(View(model));
            }

            IEnumerable <string> _errors = new string[0];
            RBACStatus           result  = RBAC_ExtendedMethods.VerifyOTP4Phone(model.UserId, model.PhoneNumber, model.Code, this.UserManager, this.SignInManager, out _errors);

            if (result == RBACStatus.Success)
            {
                return(RedirectToAction("Index", "Home"));
            }
            AddErrors(new IdentityResult(_errors));
            return(View(model));
        }