public async Task <IActionResult> Otp(OtpParameters otp) { var code = $"{otp.FirstNumber}" + $"{otp.SecondNumber}" + $"{otp.ThirdNumber}" + $"{otp.FourthNumber}"; var value = await _otpProxy.Validate(otp.UserId); if (!string.IsNullOrWhiteSpace(value) && value.Equals(code)) { var result = await _clientProxy.Activate(otp.UserId); if (result != null) { _emailSender.Send(new EmailSendParameter { ToAddress = otp.Email, Subject = "Your Account is Now Active", Body = "Hello " + result.Name + "," + Environment.NewLine + "We're glad to inform you that your account is now Active!" + Environment.NewLine + "Now you can submit tickets and our support staff will do their best to resolve your issue." }); } return(RedirectToAction("Login")); } return(View()); }
public async Task <IActionResult> Otp(OtpParameters otp) { var code = $"{otp.FirstNumber}" + $"{otp.SecondNumber}" + $"{otp.ThirdNumber}" + $"{otp.FourthNumber}"; var value = await _otpProxy.Validate(otp.UserId); if (!string.IsNullOrWhiteSpace(value) && value.Equals(code)) { return(RedirectToAction("RegistrationAttachments", new { userId = otp.UserId, email = otp.Email })); } return(View()); }