コード例 #1
0
        public async Task <ResultServiceModel <CheckForgotPinViewModel> > CheckForgotPin(DateTime birthday, string email)
        {
            CheckForgotPinCommand model = new CheckForgotPinCommand()
            {
                Birthday = birthday,
                Email    = email
            };
            string url = serviceUrl + "CheckForgotPin";

            return(await Post <CheckForgotPinViewModel>(url, model));
        }
コード例 #2
0
        public IActionResult CheckForgotPin([FromBody] CheckForgotPinCommand forgotPinCommand)
        {
            bool isUser = _userService.CheckUserByEmailAndBirthday(forgotPinCommand.Email, forgotPinCommand.Birthday);

            if (!isUser)
            {
                return(NoContent());
            }
            string refNumber = _authService.SaveOtp(forgotPinCommand.Email);

            if (string.IsNullOrEmpty(refNumber))
            {
                return(BadRequest());
            }

            CheckForgotPinViewModel checkForgot = new CheckForgotPinViewModel {
                RefNumber = refNumber
            };


            return(Ok(checkForgot));
        }