Skip to content

enableTwoFactor - EResult code 2 #537

Description

@DCFrog

Describe the bug

Getting EResult code 2 (FAIL) when trying to enable Steam Guard using enableTwoFactor method.
What I have tried so far:

  • Removing email verification (completely disabled Steam Guard) - same error
  • Using another IP address (not a VPN, legitimate residential IP) - same error
  • Enabling Steam Guard from a physical phone (iPhone) - was able to setup Steam Guard without any issues

Versions

NodeJS v20.19.5 (MacOS)
steam-user v5.3.0 / (tried older versions as well, same issue)

Code snippet I'm using

const readline = require('node:readline');
const SteamUser = require('steam-user');

(() => {
  const username = `USERNAMEHERE`;
  const password = `PASSWORDHERE`;

  console.log(`Enabling 2FA for account ${username}`);

  let client = new SteamUser();

  client.logOn({
    accountName: username,
    password: password,
  });

  client.on('loggedOn', (_details) => {
    console.log('Logged into Steam as ' + client.steamID.getSteam3RenderedID());

    client.enableTwoFactor((err, response) => {
      if (err) {
        console.error(err);
        return;
      }


      if (response.status != SteamUser.EResult.OK) {
        console.error(`EResult: ${response.status}`);
        return;
      }

      const responseJSON = JSON.stringify(response, null, 4);
      console.log(`\n${responseJSON}\n`);

      const rl = readline.createInterface({
        input: process.stdin,
        output: process.stdout,
      });

      rl.question(`Steam Guard Code: `, (code) => {
        console.log(`Code used: ${code}!`);
        rl.close();

        client.finalizeTwoFactor(response.shared_secret, code, (err) => {
          if (err) {
            console.error(err);
            return;
          }

          console.log(`2FA enabled, save JSON string for recovery!`);
        });
      });
    });
  });
})();

Screenshots and Error Logs

➜  steam-totp-enabler git:(main) ✗ node index.js
Enabling 2FA for account [REDACTED]
Logged into Steam as [U:1:REDACTED]
EResult: 2

Any ideas what can cause EResult = 2?
I was using the same script (like 8-9 months before) and it always was working without a single issue, today I wanted to enable Steam Guard on one of my accounts and faced this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions