2

Do you know how I can synchronize my server's time so that TOTP generates right codes at the right time for my steam bot? Currently using node-steam-totp.

Thanks.

BigBoyB
  • 261
  • 2
  • 10

1 Answers1

1

To generate a TOTP code synchronized with the server, you should first use node-steam-totp's getTimeOffset() method. After retrieving the offset, you can go about making your TOTP codes using the optional timeOffset parameter.

Here's an example to get you started:

totp.getTimeOffset(function(err, offset, latency) {
    var authcode = totp.getAuthCode(secret, offset);

    //do login stuff
});
Andrew
  • 273
  • 1
  • 3
  • 16