Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var steamcommunity = require("steamcommunity");
- var community = new steamcommunity();
- var SteamTotp = require("steam-totp");
- community.login({
- "accountName":"{ACCOUNTNAME}",
- "password":"{ACCOUNTPASSWORD}",
- "twoFactorCode": SteamTotp.generateAuthCode("{ACCOUNTTWOFACTORCODE}")
- },(loginError, sessionID, cookies, steamguard) => {
- if (loginError) {
- console.log(loginError);
- }
- else {
- community.loggedIn((communityError, loggedIn) => {
- if (communityError) {
- console.log("err2 was: " + communityError);
- }
- else {
- if (loggedIn) {
- SteamTotp.getTimeOffset((err, offset, latency) => {
- if (err) {
- console.log("err is: " + err);
- }
- else {
- var unixTime = SteamTotp.time(offset);
- var confirmationKey = SteamTotp.getConfirmationKey("{IDENTITYSECRET}", unixTime, "conf");
- community.getConfirmations(unixTime, confirmationKey, (err, confirmations) => {
- if (err) {
- console.log("There was an error");
- console.log(err)
- }
- else {
- console.log(confirmations);
- }
- });
- }
- });
- }
- else {
- console.log("You have not logged in");
- }
- }
- });
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment