lll Posted August 21, 2020 Report Posted August 21, 2020 This topic https://dev.doctormckay.com/topic/365-cookies/#user-cookieusage says Quote calling setCookies on the TradeOfferManager will also call setCookies on the SteamCommunity, and therefore you need not call setCookies on SteamCommunity (although it doesn't hurt anything, either) after authorization (webSession emit) i call my method to set cookie: setCookies(cookies) { return util .promisify(this.manager.setCookies) .call(this.manager, cookies); } and then it sometimes happens when I try to call this.community.acceptConfirmationForObject: D:\projects\terminal\node_modules\steamcommunity\components\confirmations.js:247 throw new Error("Must be logged in before trying to do anything with confirmations"); ^ Error: Must be logged in before trying to do anything with confirmations at request (D:\projects\terminal\node_modules\steamcommunity\components\confirmations.js:247:9) at SteamCommunity.getConfirmations (D:\projects\terminal\node_modules\steamcommunity\components\confirmations.js:17:2) at doConfirmation (D:\projects\terminal\node_modules\steamcommunity\components\confirmations.js:182:8) at D:\projects\terminal\node_modules\steamcommunity\components\confirmations.js:170:4 at IncomingMessage.<anonymous> (D:\projects\terminal\node_modules\steamcommunity\node_modules\steam-totp\index.js:129:4) 1. How can I handle such error messages? 2. This is fixed if you add cookies to the community yourself, I.E. setCookies(cookies) { this.community.setCookies(cookies); return util .promisify(this.manager.setCookies) .call(this.manager, cookies); } but it contradicts that topic Quote
Dr. McKay Posted August 21, 2020 Report Posted August 21, 2020 Can I see your TradeOfferManager constructor? Quote
lll Posted August 21, 2020 Author Report Posted August 21, 2020 constructor(details, db) { this.user = new SteamUser({ machineIdType: 3 }); this.community = new SteamCommunity({ request: this.request, userAgent }); this.manager = new TradeOfferManager({ steam: this.user, community: this.community, domain: process.env.logInDomain, language: 'en' }); this._jar = this.community._jar; this._logInDetails = details; this.user.on('error', () => { this.logOut(); }); this.user.on('loginKey', loginKey => db.update('Bots', { accountName: details.accountName }, { loginKey })); this.community.on('sessionExpired', () => this.completeLogin(false)); } "steam-tradeoffer-manager": "^2.10.2" "steam-user": "^4.16.2" "steamcommunity": "^3.41.4" Quote
Dr. McKay Posted August 21, 2020 Report Posted August 21, 2020 I don't see any reason why that shouldn't work. All I can figure is that you have an acceptConfirmationForObject call somewhere happening before you get your cookies. Quote
lll Posted August 22, 2020 Author Report Posted August 22, 2020 This definitely happens after login, and most likely has something to do with the change of public IP(before relogin) Quote
Recommended Posts
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.