From 88059596b339c4f4181e50ac00dea00773b11257 Mon Sep 17 00:00:00 2001 From: Alexander Corn Date: Sat, 30 May 2015 23:45:46 -0400 Subject: [PATCH] Use a string for the steamguard value instead of an object --- index.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index f594529..a1a6ae7 100644 --- a/index.js +++ b/index.js @@ -13,8 +13,9 @@ function SteamCommunity() { } SteamCommunity.prototype.login = function(details, callback) { - if(details.steamID && details.sentry) { - this._jar.setCookie(Request.cookie('steamMachineAuth' + details.steamID.getSteamID64() + '=' + encodeURIComponent(details.sentry)), 'https://steamcommunity.com'); + if(details.steamguard) { + var parts = details.steamguard.split('||'); + this._jar.setCookie(Request.cookie('steamMachineAuth' + parts[0] + '=' + encodeURIComponent(parts[1])), 'https://steamcommunity.com'); } var self = this; @@ -80,7 +81,7 @@ SteamCommunity.prototype.login = function(details, callback) { for(var i = 0; i < cookies.length; i++) { var parts = cookies[i].split('='); if(parts[0] == 'steamMachineAuth' + self.steamID) { - steamguard = {"steamID": self.steamID, "sentry": decodeURIComponent(parts[1])}; + steamguard = self.steamID.toString() + '||' + decodeURIComponent(parts[1]); break; } }