mirror of
https://github.com/DoctorMcKay/node-steamcommunity.git
synced 2025-04-01 13:10:10 +08:00
Fixed finalizeTwoFactor checking success before want_more (fixes #16)
This commit is contained in:
parent
b54ccff7c8
commit
49d2bb4252
@ -92,7 +92,6 @@ SteamCommunity.prototype.finalizeTwoFactor = function(secret, activationCode, ca
|
|||||||
}
|
}
|
||||||
|
|
||||||
body = body.response;
|
body = body.response;
|
||||||
console.log(body);
|
|
||||||
|
|
||||||
if(body.server_time) {
|
if(body.server_time) {
|
||||||
diff = body.server_time - Math.floor(Date.now() / 1000);
|
diff = body.server_time - Math.floor(Date.now() / 1000);
|
||||||
@ -100,13 +99,13 @@ SteamCommunity.prototype.finalizeTwoFactor = function(secret, activationCode, ca
|
|||||||
|
|
||||||
if(body.status == 89) {
|
if(body.status == 89) {
|
||||||
callback(new Error("Invalid activation code"));
|
callback(new Error("Invalid activation code"));
|
||||||
} else if(!body.success) {
|
|
||||||
callback(new Error("Error " + body.status));
|
|
||||||
} else if(body.want_more) {
|
} else if(body.want_more) {
|
||||||
attemptsLeft--;
|
attemptsLeft--;
|
||||||
diff += 30;
|
diff += 30;
|
||||||
|
|
||||||
finalize(token);
|
finalize(token);
|
||||||
|
} else if(!body.success) {
|
||||||
|
callback(new Error("Error " + body.status));
|
||||||
} else {
|
} else {
|
||||||
callback(null);
|
callback(null);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user