From 0c4e026701c1efa75f40b710fecaa3c133c1a8c4 Mon Sep 17 00:00:00 2001 From: Alexander Corn Date: Sat, 26 Dec 2015 18:34:22 -0500 Subject: [PATCH] Require steamguard value in oAuthLogin method --- index.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/index.js b/index.js index ceb2021..4fb068b 100644 --- a/index.js +++ b/index.js @@ -170,10 +170,9 @@ SteamCommunity.prototype.login = function(details, callback) { } }; -SteamCommunity.prototype.oAuthLogin = function(steamID, token, callback) { - if(typeof steamID !== 'object') { - steamID = new SteamID(steamID); - } +SteamCommunity.prototype.oAuthLogin = function(steamguard, token, callback) { + steamguard = steamguard.split('||'); + var steamID = new SteamID(steamguard[0]); var self = this; this.request.post({ @@ -193,8 +192,9 @@ SteamCommunity.prototype.oAuthLogin = function(steamID, token, callback) { } var cookies = [ - 'steamLogin=' + steamID.getSteamID64() + '||' + body.response.token, - 'steamLoginSecure=' + steamID.getSteamID64() + '||' + body.response.token_secure, + 'steamLogin=' + encodeURIComponent(steamID.getSteamID64() + '||' + body.response.token), + 'steamLoginSecure=' + encodeURIComponent(steamID.getSteamID64() + '||' + body.response.token_secure), + 'steamMachineAuth' + steamID.getSteamID64() + '=' + steamguard[1], 'sessionid=' + self.getSessionID() ];