Пример #1
0
 public OTPView()
 {
     InitializeComponent();
     vModel                      = new OTPViewModel(Navigation);
     BindingContext              = vModel;
     GlobalEvents.OnSMSReceived += GlobalEvents_OnSMSReceived;
 }
Пример #2
0
 //  [ValidateAntiForgeryToken]
 public ActionResult VerifyOTP(OTPViewModel OVM)
 {
     try
     {
         // TODO: Add insert logic here
         if (Session["OTP"] != null && OVM.OTP != null && OVM.OTP != string.Empty)
         {
             if (Session["OTP"].ToString() == OVM.OTP.ToString())
             {
                 Session["OTPConfirmed"] = "True";
                 if (TempData["OTPSource"] != null && Convert.ToString(TempData["OTPSource"]) == "ForgotPassword")
                 {
                     return(RedirectToAction("ForgotPassword", "TrueWheelsUser"));
                 }
                 else
                 {
                     return(RedirectToAction("Index", "UserDashbaord"));
                 }
             }
             else
             {
                 ViewBag.Error = "Invalid OTP";
                 return(View());
             }
             // return RedirectToAction("Login", "TrueWheelsUser");
         }
         return(View());
     }
     catch
     {
         return(View());
     }
 }
Пример #3
0
 public async Task <IActionResult> DirectSignUpOtpVerification([FromBody] OTPViewModel model)
 {
     if (model != null)
     {
         SignUpMobileWithOTPResponse response = new SignUpMobileWithOTPResponse();
         response.ReturnCode    = 200;
         response.ReturnMsg     = "Success";
         response.StatusCode    = 200;
         response.StatusMessage = "Done";
         return(Ok(response));
     }
     else
     {
         ModelState.AddModelError(string.Empty, "Invalid OTP.");
         return(BadRequest(new ApiError(ModelState)));
     }
 }
Пример #4
0
 public OTPView()
 {
     InitializeComponent();
     vModel         = new OTPViewModel(Navigation);
     BindingContext = vModel;
     //GlobalEvents.OnSMSReceived += GlobalEvents_OnSMSReceived;
     MessagingCenter.Subscribe <string>(this, "ReceivedOTP", (message) =>
     {
         string[] words = message.Split();
         foreach (string item in words.ToList())
         {
             var isNumeric = int.TryParse(item, out int n);
             if (isNumeric)
             {
                 OTP.Text = item;
                 break;
             }
         }
     });
 }