Jump to content
McKay Development

loginKey never wants to be emitted


Recommended Posts

Hey. I've been trying since few days any possible way to get Steam emitted to me. There's few lines how I try to catch it.

var SteamUser = require('steam-user');
var client = new SteamUser();

var SteamCommunity = require('steamcommunity');
let community = new SteamCommunity();

community.login({
      "accountName": loginAccount,
      "password": loginPassword,
      "twoFactorCode": loginCode,
      "rememberPassword": true,
      "machineName": "firstMachineThere"
    }, function(err, sessionID, cookies, steamguard){
      community.getClientLogonToken((err, details) => {
          if(err){
            console.log('error : ' + err);
          }else{
            details.rememberPassword = true;
            details.machineName = 'firstMachineThere';
            client.logOn(details);
          }
        });
});

client.on('loginKey', key => {
  console.log('Got new loginKey -> save that! ' + key);
  con.query('UPDATE bots_login_info SET loginkey="'+key+'" WHERE ID = ' + tokenIDBase);
  console.log('Updated in DB');
});

 

 

Fixed by logging with 2FA code to steam-user instead of community and making steam-user login with logon token.

 

Edited by Seeb
edit code
Link to post
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...