node-steam-user icon indicating copy to clipboard operation
node-steam-user copied to clipboard

Instantly getting disconnected with right credentials

Open marco-krammer opened this issue 9 years ago • 2 comments

Hello,

I tried to logOn to a Steam account with this code:

var sharedSecret =  'XXXXXX';

steamUser.logOn({
  account_name: 'username',
  password: 'password',
  twoFactorCode: SteamTotp.generateAuthCode('sharedSecret')
});

When I am trying to run it with node I am getting this as reply:

events.js:182
  throw er; // Unhandled 'error' event
  ^

Error: Disconnected
    at SteamClient._disconnected (/projects/node/SteamTradeBot/node_modules/steam/lib/steam_client.js:186:24)
    at emitOne (events.js:115:13)
    at Connection.emit (events.js:210:7)
    at TCP._handle.close [as _onclose] (net.js:549:12)

I don't know how I should fix this error. Thank you in Advance!

Regards, Marco

P.S. I am getting the right authCode with SteamTotp if I do console.log(sharedSecret)

marco-krammer avatar Jul 29 '17 08:07 marco-krammer

Change account_name to accountName?

Rob-- avatar Jul 29 '17 14:07 Rob--

I just found the mistake: The error was thrown by something later on in my code. @Rob-- Thank you for your answer anyway :)

marco-krammer avatar Jul 29 '17 14:07 marco-krammer