Example #1
0
        public JsonResult VerifyNumberAjax(VarifyNumberModel model)
        {
            if (string.IsNullOrEmpty(model?.Code) || string.IsNullOrEmpty(model.UserId) || string.IsNullOrEmpty(model.Phone))
            {
                return(Json(new { status = false, message = "Bad Request" }, JsonRequestBehavior.AllowGet));
            }
            var status = UserManager.ChangePhoneNumber(model.UserId, model.Phone, model.Code);

            if (!status.Succeeded)
            {
                return(Json(new { status = false, message = "Unable to verify mobile number" }, JsonRequestBehavior.AllowGet));
            }
            return(Json(new { status = true, message = "success" }, JsonRequestBehavior.AllowGet));
        }
Example #2
0
        public ActionResult VerifyNumber()
        {
            var userId = TempData["userId"].ToString();
            var mobile = TempData["userNumber"].ToString();

            GeneratePhoneCode(userId, mobile);

            var model = new VarifyNumberModel
            {
                UserId = userId,
                Phone  = mobile
            };

            return(View(model));
        }
Example #3
0
 public JsonResult ReGeneratePhoneCode(VarifyNumberModel model)
 {
     GeneratePhoneCode(model.UserId, model.Phone);
     return(Json(new { status = true, message = "success" }, JsonRequestBehavior.AllowGet));
 }