Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Machine ID inconsistent between logins #502

Open
Sadzurami opened this issue Oct 19, 2024 · 3 comments
Open

Machine ID inconsistent between logins #502

Sadzurami opened this issue Oct 19, 2024 · 3 comments
Labels

Comments

@Sadzurami
Copy link
Contributor

Sadzurami commented Oct 19, 2024

Describe the bug

For machine id creation SteamUser uses account_name | steamid, while SteamSession only uses account_name as account identifier.

When we logs using SteamUser with refresh token, instance will use steamid, we can't pass account_name.
While SteamSession used account_name while refresh token was created.

if (details.refreshToken) {
// If logging in with a refresh token, we need to make sure that no conflicting properties are set
let disallowedProps = [
'account_name',
'password',
'auth_code',
'two_factor_code'
];
disallowedProps.forEach((prop) => {
if (this._logOnDetails[prop]) {
throw new Error(`Cannot specify ${prop} when logging in with a refresh token`);
}
});

module.exports = {
autoRelogin: true,
machineIdType: EMachineIDType.AccountNameGenerated,

// The user wants to use a machine ID that's generated off the account name
if (this.options.machineIdType == EMachineIDType.AccountNameGenerated) {
return createMachineID(
this.options.machineIdFormat[0].replace(/\{account_name\}/g, this._getAccountIdentifier()),
this.options.machineIdFormat[1].replace(/\{account_name\}/g, this._getAccountIdentifier()),
this.options.machineIdFormat[2].replace(/\{account_name\}/g, this._getAccountIdentifier())
);
}

_getAccountIdentifier() {
return this._logOnDetails.account_name
|| this._logOnDetails._newAuthAccountName
|| this._logOnDetails._steamid.toString();
}

Versions

5.2.0

@Sadzurami Sadzurami added the bug label Oct 19, 2024
@Sadzurami
Copy link
Contributor Author

Sadzurami commented Oct 19, 2024

Proposal: allow to pass account_name to logOn options.

@Sadzurami
Copy link
Contributor Author

Also proposal, but not related this issue: move functions like 'createMachineId' and 'createMachineName', which uses by
both SteamUser and SteamSession, to separate package, like @doctormckay/stdlib/hardware or @doctormckay/steam-hardware or smth like that. Main idea - keep consistency between packages, that consumes that functional.

@Sadzurami
Copy link
Contributor Author

Sadzurami commented Oct 19, 2024

Also proposal: allow to pass machine_id directly to logOn method, like it implemented in SteamSession options.

@Sadzurami Sadzurami changed the title Machine ID inconsistent between SteamUser and SteamSession Machine ID inconsistent between logins Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant