Beispiel #1
0
        public async Task <CheckSecureCodeResultModel> CheckSecureCode(LoginStepTwoModel model)
        {
            var result = await _requestManagerService.Post <ServiceResponse <CheckSecureCodeResultModel> >("/check_secure_code", model);

            if (result?.Code != 1 && result?.Code != 200)
            {
                return new CheckSecureCodeResultModel
                       {
                           IsInvalid = true
                       }
            }
            ;
            return(result.DataModel);
        }
Beispiel #2
0
        public async Task <IActionResult> StepTwo([FromBody] LoginStepTwoModel model)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }

            var result = await _twoStepVerificationService.CheckSecureCode(model);

            if (result != null)
            {
                _login(result.Username, model.Phone, result.Hash, result.ID);
            }
            return(Json(result));
        }