From fb0097499d68a12c68dd0d2c96aa43462125dea6 Mon Sep 17 00:00:00 2001 From: Alexander Corn Date: Wed, 20 Jan 2016 23:04:54 -0500 Subject: [PATCH] Added some more debug output to confirmation checker --- components/confirmations.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/components/confirmations.js b/components/confirmations.js index 979a282..20a6ff4 100644 --- a/components/confirmations.js +++ b/components/confirmations.js @@ -239,6 +239,7 @@ SteamCommunity.prototype.checkConfirmations = function() { self.getConfirmations(key.time, key.key, function(err, confirmations) { if(err) { + this.emit('debug', "Can't check confirmations: " + err.message); resetTimer(); return; } @@ -287,9 +288,14 @@ SteamCommunity.prototype.checkConfirmations = function() { // Delay them by 1 second per new confirmation that we see, so that keys won't be the same. setTimeout(function() { if(self._identitySecret) { - self.emit('debug', 'Accepting confirmation ' + conf.id); + self.emit('debug', 'Accepting confirmation #' + conf.id); var time = Math.floor(Date.now() / 1000); - conf.respond(time, SteamTotp.getConfirmationKey(self._identitySecret, time, "allow"), true, function() { + conf.respond(time, SteamTotp.getConfirmationKey(self._identitySecret, time, "allow"), true, function(err) { + if (err) { + self.emit('debug', "Can't accept confirmation #" + conf.id + ": " + err.message); + } + + // We'll just retry next time we poll delete self._knownConfirmations[conf.id]; }); } else {