Jump to content
McKay Development

Recommended Posts

Posted

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);
        });
  • 5 months later...
Posted

 

  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.

 

 

 

Is it right code?

[[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-user');
var client = new SteamUser();

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);
        });

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...