public async Task <IActionResult> VerificationCode(VerificationCodeDto codeDto) { var verificationCode = await mediator.Send(new VerificationCommand { Code = codeDto.Code, HashCode = codeDto.HashCode }); if (verificationCode.Success) { return(Ok()); } return(BadRequest(verificationCode.ErrorMessage)); }
public ActionResult <string> GetVerificationCode([FromQuery] VerificationCodeDto verificationCodeDto) { string vCode = this.verificationCodeHelper.getVerificationCode(verificationCodeDto.Email); if (string.IsNullOrWhiteSpace(vCode)) { return(BadRequest()); } //throw new System.Exception("Server error!"); return(Ok(new { message = "The verification code has been sent to your email box." })); }