예제 #1
0
        public async Task <ResultServiceModel <CheckOtpViewModel> > CheckOtp(string email, string otp, string refNumber)
        {
            string          url        = Helper.BaseUrl + "auth/CheckOtp";
            CheckOtpCommand otpCommand = new CheckOtpCommand
            {
                Email     = email,
                Otp       = otp,
                RefNumber = refNumber
            };

            return(await Post <CheckOtpViewModel>(url, otpCommand));
        }
        public IActionResult CheckOtp([FromBody] CheckOtpCommand command)
        {
            string email     = command.Email;
            string otp       = command.Otp;
            string refNumber = command.RefNumber;

            bool isValidateOtp = _authService.ValidateOtp(email, otp, refNumber);

            CheckOtpViewModel viewModel = new CheckOtpViewModel
            {
                IsValidateOtp = isValidateOtp
            };

            return(Ok(viewModel));
        }