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.