From 477e3dba33d0a1a5f7c803e793f6918b3cd7d892 Mon Sep 17 00:00:00 2001 From: Hitesh Walia Date: Thu, 25 Jul 2019 09:06:56 -0700 Subject: [PATCH] integration tests passed --- lib/index.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/index.js b/lib/index.js index 4e62c9b..5c71abb 100644 --- a/lib/index.js +++ b/lib/index.js @@ -25,8 +25,6 @@ module.exports.create = function(config) { return elem.name; }); }); - - }, set: function(data) { // console.info('Add TXT', data); @@ -55,12 +53,11 @@ module.exports.create = function(config) { return api('GET', '/' + account + '/zones/' + data.challenge.dnsZone + '/records') .then(function(resp) { - var txtRecord = resp.body.data.filter(function (record) { + var record = resp.body.data.filter(function (record) { return data.challenge.dnsAuthorization === record.content; })[0]; - //console.log('DEBUG >>> txtRecord: ' + JSON.stringify(txtRecord,null,2)); - if(txtRecord) return { dnsAuthorization: txtRecord.content }; + if(txtRecord) return { dnsAuthorization: record.content }; else return null; });