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 Friday at 01:38 PM Report Posted Friday at 01:38 PM (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 Friday at 01:49 PM by Gospodinoff Quote
Dr. McKay Posted yesterday at 05:12 AM Report Posted yesterday at 05:12 AM Show your code please. Quote
Gospodinoff Posted 2 hours ago Report Posted 2 hours ago 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
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.