From 49d2bb42527cac096073a5f2b161b9db1e72470f Mon Sep 17 00:00:00 2001 From: Alexander Corn Date: Wed, 2 Dec 2015 21:33:33 -0500 Subject: [PATCH] Fixed finalizeTwoFactor checking success before want_more (fixes #16) --- components/twofactor.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/components/twofactor.js b/components/twofactor.js index 9f4c9e1..da79035 100644 --- a/components/twofactor.js +++ b/components/twofactor.js @@ -92,7 +92,6 @@ SteamCommunity.prototype.finalizeTwoFactor = function(secret, activationCode, ca } body = body.response; - console.log(body); if(body.server_time) { diff = body.server_time - Math.floor(Date.now() / 1000); @@ -100,13 +99,13 @@ SteamCommunity.prototype.finalizeTwoFactor = function(secret, activationCode, ca if(body.status == 89) { callback(new Error("Invalid activation code")); - } else if(!body.success) { - callback(new Error("Error " + body.status)); } else if(body.want_more) { attemptsLeft--; diff += 30; finalize(token); + } else if(!body.success) { + callback(new Error("Error " + body.status)); } else { callback(null); }