Jump to content
McKay Development

Cant login to SteamCommunity, [Error: SteamGuardMobile]


spazhead

Recommended Posts

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

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...