Пример #1
0
        private async Task <ApiResponse> ResetUserPassword(ResetPasswordViewModel model)
        {
            var apiResp = new ApiResponse
            {
                Type = ResponseType.Fail
            };

            var confirmResp = await _security.ConfirmPasswordReset(model.Password, model.SecurityCode);

            if (confirmResp.Type != ResponseType.Success)
            {
                apiResp.ErrorCode = confirmResp.ErrorCode;
                return(apiResp);
            }

            var resp = await _security.ChangePassword(confirmResp.Data, model.Password);

            if (resp.Type != ResponseType.Success)
            {
                apiResp.ErrorCode = resp.ErrorCode;
                return(apiResp);
            }

            apiResp.Type = ResponseType.Success;
            return(apiResp);
        }