spazhead Posted May 17, 2016 Report Posted May 17, 2016 Hello all! I have seen a similar question here, but to my understanding, it wasn't answered.https://dev.doctormckay.com/topic/251-cant-make-a-simple-login-due-to-steamguardmobile/ My code is as follows: var diff = 0; SteamTotp.getTimeOffset(function(err, d, l) { diff = d; }); console.log(diff); var code = SteamTotp.generateAuthCode(config.secret, diff); community.login({ "accountName": config.username, "password": config.password, "twoFactorCode": code, }, function(err){ if (err) { console.log(err); process.exit(1); } communityloggedin = true; console.log("Logged on to SteamCommunity with "+config.username); }); Unfortunately, I get the error [Error: SteamGuardMobile]. The answer to the other question linked above had an answer but I failed to see the fix. Thanks for your time, Spazhead Quote
Dr. McKay Posted May 17, 2016 Report Posted May 17, 2016 Your clock is wrong, your secret is wrong, or you're trying to reuse a code. I see that you're trying to get the time offset, but what you're doing won't work as you aren't waiting for the callback. Please read a bit about how asynchronous JavaScript works. If you want the time offset check to work, then you need to put everything inside the callback of getTimeOffset. Quote
spazhead Posted May 18, 2016 Author Report Posted May 18, 2016 Thanks for the reply, I have moved the community login code inside the callback and added a large delay (20 seconds) before the second code is generated. This corrected the issue! I had no idea that you couldn't use the same Steam Guard code twice. Thank you so much, Spazhead Quote
Dr. McKay Posted May 18, 2016 Report Posted May 18, 2016 Why are you logging in twice within 30 seconds anyway? Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.