Jump to content


Photo
Question

Error: Must be logged in before trying to do anything with confirmations

node.js node-steamcommunity

Best Answer Dr. McKay , 04 February 2019 - 08:03 PM

  1. That's not how you use steam-client; you're probably looking to use steam-user
  2. Don't use community.startConfirmationChecker. Per the docs, no support will be provided for code that uses confirmation polling.
Go to the full post


  • Please log in to reply
1 reply to this topic

#1 Asf

Asf

    Newbie

  • Member
  • Pip
  • 1 posts

Posted 04 February 2019 - 04:52 PM

Hello 

 

Error: Must be logged in before trying to do anything with confirmations

 

I get this error when executing code in BAS (Browser Automation Studio)

[[IDENTITY_SECRET]] = JSON.parse([[FILE_CONTENT]]).identity_secret
var SteamTotp = require('steam-totp');
[[code2]] = SteamTotp.generateConfirmationKey([[IDENTITY_SECRET]]);
[[code3]] = SteamTotp.getConfirmationKey([[code2]]);
[[TIME]] = SteamTotp.time([[timeOffset]]);

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

var Steam = require('steam-client');
var client = new Steam.CMClient(Steam.EConnectionProtocol.TCP);

var TradeOfferManager = require('steam-tradeoffer-manager');
var manager = new TradeOfferManager();

client.on('webSession', (sessionID, cookies) => {
  manager.setCookies(cookies, function (err) {
    if (err) {
      logger.error(err) //игнор.прав
      process.exit(1);
    }
  });

  community.setCookies(cookies);
  community.startConfirmationChecker(10000, [[code3]]);
});

        var time = [[TIME]];
        var confKey = [[code3]];
        var allowKey = [[code3]];
        
        community.acceptAllConfirmations(time, confKey, allowKey, function(err, confs){
             if(err){
                res.sendError(err);
              return;
           }
            if(confs == null) confs = [];
            res.sendSuccess(confs);
        });


#2 Dr. McKay

Dr. McKay

    Developer

  • Administrator
  • 2,038 posts

Posted 04 February 2019 - 08:03 PM   Best Answer

  1. That's not how you use steam-client; you're probably looking to use steam-user
  2. Don't use community.startConfirmationChecker. Per the docs, no support will be provided for code that uses confirmation polling.






Also tagged with one or more of these keywords: Question, node.js, node-steamcommunity

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users