geeknux Posted June 14, 2016 Report Posted June 14, 2016 HI, i trying to write a bot manager for trading, i try to get my secrect id and shared code by using this code: var SteamCommunity = require('steamcommunity'); var community = new SteamCommunity(); community.login({ "accountName": "MyAccountName", "password": "MyPassword", "twoFactorCode": "6 char code that i receive from steam guard mobile" }, function (err, sessionId, cookies, steamGuard, token) { if (err) { console.log(err); } else { community.loggedIn(function (err, result) { if (err) { console.log("loggedIn error: ", err); } else { community.enableTwoFactor(function (err, response) { if (err) { console.log("twoFactor Error: ", err); } else { console.log("response", response); community.finalizeTwoFactor(response.shared_secret, test, function(err, result){ if("finalizeTwoFactor Error: ", err) { } else { console.log("finalizeTwoFactor Success: ", result); } }); } }); } }); } }); I enabled my bot account with steam guard mobile, and verify the number, but when i try to start that code i get this error: twoFactor Error: { [Error: Error 29] eresult: 29 } what did i miss here? i try to search in this forum and google but i can't find my answer. Quote
Dr. McKay Posted June 14, 2016 Report Posted June 14, 2016 DuplicateRequest You can't enable 2FA if you already have 2FA enabled. Quote
geeknux Posted June 15, 2016 Author Report Posted June 15, 2016 Thanks, for you're reply, i resolve my problem, i revoke steam guard from my mobile first, then using the sample code for enabling 2fa from steamcommunity github, and that worked for me. Quote
Gospodinoff Posted November 14 Report Posted November 14 (edited) @Dr. McKay I'm having the same error right now. 2FA isn't connected (only via email). How can I fix this? My solution: First, I enter my username/password. A code is sent to my email. I enter my username/password and the code again. And I get this error: DuplicateRequest Edited November 14 by Gospodinoff Quote
Gospodinoff Posted November 16 Report Posted November 16 The code is event-driven. First, login() is called. Then, the "steam guard" code is entered, and the login() request is repeated. Quote async login(data: LoginSchema) { const options: { accountName: string, password: string, disableMobile: boolean, authCode?: string, twoFactorCode?: string } = { accountName: data.username, password: data.password, disableMobile: false, }; if (data.username === '' || data.password === '') { this.logger.log('info', 'AuthManager:login Проверка введённых данных', { message: 'Вы не ввели логин и/или пароль!', data: options }); this.mainWindow.webContents.send('accounts:auth:callback', { type: 'warning', message: 'Вы не ввели логин и/или пароль!', data: data, nextStep: null, nextEvent: null, redirect: {name: 'accounts-add'} }); return; } if (data.code) { options.authCode = data.code; this.logger.log('info', 'AuthManager:login Второй вызов, по идеи, с кодом', { message: 'Подтверждаем SteamGuard код, высланный на почту', data: options, }); } this.logger.log('info', 'AuthManager:login Итоговые данные для передачи в авторизацию', { data: options, }); this.SteamCommunity.login(options, async (err: any, sessionID: string, cookies: string[]) => { if (err) { this.logger.log('info', 'AuthManager:login Выводим общую ошибку', { message: err.message, }); let message = ''; switch (err.message) { case 'RateLimitExceeded': message = 'Ваша учётная запись попала в лимиты запросов. Повторите попытку позднее!'; this.logger.log('info', 'AuthManager:login Error: RateLimitExceeded', { message: message, }); this.mainWindow.webContents.send('accounts:auth:callback', { type: 'warning', message: message, data: data, nextStep: null, nextEvent: null, redirect: {name: 'index'} }); break; case 'SteamGuard': message = `На вашу почту "**********${err.emaildomain}" отправлено письмо с кодом подтверждения. Введите его в поле.`; this.logger.log('info', 'AuthManager:login Error: SteamGuard', { message: message }); this.mainWindow.webContents.send('accounts:auth:callback', { type: 'success', message: message, data: data, nextStep: 'steamguard', nextEvent: 'accounts:auth:submit_code', }); break; case 'SteamGuardMobile': message = `Введите код из мобильного аутентификатора.`; this.logger.log('info', 'AuthManager:login Error: SteamGuardMobile', { message: message, }); this.mainWindow.webContents.send('accounts:auth:callback', { type: 'success', message: message, data: data, nextStep: 'steamguard_mobile', nextEvent: 'accounts:auth:submit_code', }); break; case 'DuplicateRequest': message = 'Steam Guard Mobile уже подключён или произошёл дубликат запросов на добавление Steam Guard Mobile.'; this.logger.log('info', 'AuthManager:login Error: DuplicateRequest', { message: message, }); this.mainWindow.webContents.send('accounts:auth:callback', { type: 'warning', message: message, data: data, nextStep: null, nextEvent: null, redirect: {name: 'index'} }); break; default: message = err.message; this.logger.log('info', 'AuthManager:login', { message: message, }); break; } } else { this.logger.log('info', 'AuthManager:login', { message: 'Всё прошло успешно, начинаем установку 2fa', }); console.log('sessionID', sessionID) this.AccountStorageManager.save(data.username, { account: { username: data.username, }, cookies: cookies, }); // Начинаем установку 2FA this.startTwoFactor(data); } }); } Quote
Dr. McKay Posted Wednesday at 10:39 AM Report Posted Wednesday at 10:39 AM You're getting DuplicateRequest in the login callback? Quote
Gospodinoff Posted Wednesday at 12:01 PM Report Posted Wednesday at 12:01 PM 1 hour ago, Dr. McKay said: You're getting DuplicateRequest in the login callback? Yes, after a repeated request to the login() method. The first time I initiate authorization, I receive a Steam Guard code via email. Then I call the same login() method, but with the code inside. And then I receive a DuplicateRequest. The same problem occurs when working with steam-session: First, I call startWithCredentials(), and then submitSteamGuardCode(). Quote
Dr. McKay Posted Thursday at 06:58 AM Report Posted Thursday at 06:58 AM I don't know why you'd get DuplicateRequest when logging in if you're doing everything correctly. Maybe the code was already used? Quote
Gospodinoff Posted 1 hour ago Report Posted 1 hour ago On 20.11.2025 at 09:58, Dr. McKay said: Не понимаю, почему при входе возникает ошибка DuplicateRequest, если всё сделано правильно. Может быть, этот код уже был использован? I suspect the problem isn't in the code, but in the overall implementation of ElectronJS (which I use) applications. Everything works fine in development mode, but as soon as I create an .exe application, I get this error. But I haven't yet figured out the cause of this problem. 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.