johnnyJ Posted June 28, 2018 Report Share Posted June 28, 2018 How im working now with node-steam-user and i would like to know how can i find out what user need to enter authCode or twoFactorCode when he is trying to log in with my app with logOn(); Quote Link to comment Share on other sites More sharing options...
Dr. McKay Posted June 28, 2018 Report Share Posted June 28, 2018 You can't know until you try to login. If settings are left at their default, the module will prompt for the appropriate code from stdin. You can set promptSteamGuardCode to false and listen for the steamGuard event if you want, and that will also tell you what kind of code it needs. Quote Link to comment Share on other sites More sharing options...
johnnyJ Posted June 29, 2018 Author Report Share Posted June 29, 2018 I set client.setOption(SteamUser.promptSteamGuardCode, false); and then i try to log in,but still steamGuard event doesnt working.Am i doing smth wrong? Quote Link to comment Share on other sites More sharing options...
johnnyJ Posted June 29, 2018 Author Report Share Posted June 29, 2018 (edited) You can't know until you try to login. If settings are left at their default, the module will prompt for the appropriate code from stdin. You can set promptSteamGuardCode to false and listen for the steamGuard event if you want, and that will also tell you what kind of code it needs.I set promptSteamGuardCode to false but steamGuard event still doesnt work var SteamUser = require('steam-user'); // Replace this with `require('steam-user');` if used outside of the module directory var client = new SteamUser(); client.setOption(SteamUser.promptSteamGuardCode, false); client.logOn({ "accountName": "accountName", "password": "password" }); client.on('loggedOn', function(details) { console.log("Logged into Steam as " + client.steamID.getSteam3RenderedID()); client.setPersona(SteamUser.EPersonaState.Online); client.gamesPlayed(440); setTimeout(function() { client.logOff(); console.log("Bye"); }, 3000); }); client.on('error', function(e) { // Some error occurred during logon console.log(e); }); client.on('steamGuard', function(domain, callback) { console.log("Steam Guard code needed from email ending in " + domain); console.log("dsmdsad"); var code = getCodeSomehow(); callback(code); }); client.on('webSession', function(sessionID, cookies) { console.log("Got web session"); // Do something with these cookies if you wish }); client.on('emailInfo', function(address, validated) { console.log("Our email address is " + address + " and it's " + (validated ? "validated" : "not validated")); }); client.on('wallet', function(hasWallet, currency, balance) { console.log("Our wallet balance is " + SteamUser.formatCurrency(balance, currency)); }); client.on('vacBans', function(numBans, appids) { console.log("We have " + numBans + " VAC ban" + (numBans == 1 ? '' : 's') + "."); if (appids.length > 0) { console.log("We are VAC banned from apps: " + appids.join(', ')); } }); Edited June 29, 2018 by johnnyJ Quote Link to comment Share on other sites More sharing options...
Dr. McKay Posted June 29, 2018 Report Share Posted June 29, 2018 client.setOption('promptSteamGuardCode', false); Quote Link to comment Share on other sites More sharing options...
johnnyJ Posted June 29, 2018 Author Report Share Posted June 29, 2018 client.setOption('promptSteamGuardCode', false);Ohhh...thanks) Quote Link to comment Share on other sites More sharing options...
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.