DoctorMcKay / node-steam-session

Node.js module for authenticating with the Steam auth server. Allows for generating refresh tokens and web auth cookies for use with steam-user and other packages.
https://www.npmjs.com/package/steam-session
MIT License
112 stars 20 forks source link

steamGuardMachineToken issue #12

Closed say1j closed 1 year ago

say1j commented 1 year ago

Some (not all) instanses during logging in with hash have error thrown. With multiple restarts have same. Working fine with steamGuardMachineToken commented.

let hash = createHash('sha1');
if (fs.existsSync(`machineHash_${this._config.account_name}`))
  hash.update(fs.readFileSync(`machineHash_${this._config.account_name}`));
else fs.writeFileSync(`machineHash_${this._config.account_name}`, hash.digest());
let hashBuffer = hash.digest();

this._session.startWithCredentials({
  ...
  steamGuardMachineToken: hashBuffer,
});

error: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason: TypeError: string.charCodeAt is not a function at Object.utf8_write [as write] (/root/asd/node_modules/@protobufjs/utf8/index.js:85:21) at Op.writeStringBuffer [as fn] (/root/asd/node_modules/steam-session/node_modules/protobufjs/src/writer_buffer.js:59:19) at BufferWriter.finish (/root/asd/node_modules/steam-session/node_modules/protobufjs/src/writer.js:453:14) at AuthenticationClient.sendRequest (/root/asd/node_modules/steam-session/dist/AuthenticationClient.js:214:60) at AuthenticationClient.startSessionWithCredentials (/root/asd/node_modules/steam-session/dist/AuthenticationClient.js:63:33) at LoginSession.startWithCredentials (/root/asd/node_modules/steam-session/dist/LoginSession.js:178:58) at processTicksAndRejections (internal/process/task_queues.js:95:5)

say1j commented 1 year ago

Also wondering if clientOS support will be added such as in steam-user logOn option

DoctorMcKay commented 1 year ago

Sorry about that, that's fixed in 1.2.1.

At some point I probably will add the ability to specify your own client OS, but it's only relevant for EAuthTokenPlatformType.MobileApp logins. SteamClient and WebBrowser login sessions don't send an OS type.