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; });