My project is very simple. All I want to do is change my profile name by running a script. The name is hard coded, the account is hard coded.
I'm trying to log in without having to provide the two factor code each time I want to run this script. My final goal is to be able to run this script with a push of a button.
I was able to get it working with this:
const SteamCommunity = require('steamcommunity')
const Community = new SteamCommunity()
Community.login(
{
"accountName": "",
"password": "",
"authCode": "",
"disableMobile": false
}, (err, sessionID, steamguard, oAuthToken) => {
Community.editProfile(
{
name: "anything"
},
(err) => {
console.log("anything", err)
}
)
}
)
obviously filling out the correct info for my account. Without having steam guard, I was able to change the name no problem. However I want steam guard enabled for obvious reasons but every time I want to run this code, I don't want to input the new authCode.
I can't figure out how to get oAuthLogin(steamguard, oAuthToken, callback) working. The steamguard parameter is confusing to me because the documentation says it's this "YourSteamID||YourCookieValue" but when I get the return it's an array so I can't just pass what I get into oAuthLogin and when I tried to make it a string, I just recreated the oAuthToken thinking I was combining the right info.
My last run ended up with a 401 error and I'm just completely lost. This is also my first time working with node.
Any advice on what to try or direction of where I should be looking?
Solution: