From 12cffdd62c42aab96df53402ec4ea19130a05426 Mon Sep 17 00:00:00 2001 From: Alexander Corn Date: Fri, 17 Jul 2015 21:19:43 -0400 Subject: [PATCH] Added Family View status to loggedIn method callback --- index.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 8c31fca..eb659b8 100644 --- a/index.js +++ b/index.js @@ -237,12 +237,17 @@ SteamCommunity.prototype.resetItemNotifications = function(callback) { SteamCommunity.prototype.loggedIn = function(callback) { this.request("https://steamcommunity.com/my", {"followRedirect": false}, function(err, response, body) { - if(err || response.statusCode != 302) { + if(err || (response.statusCode != 302 && response.statusCode != 403)) { callback(err ? err.message : "HTTP error " + response.statusCode); return; } - callback(null, !!response.headers.location.match(/steamcommunity\.com(\/(id|profiles)\/[^\/]+)\/?/)); + if(response.statusCode == 403) { + callback(null, true, true); + return; + } + + callback(null, !!response.headers.location.match(/steamcommunity\.com(\/(id|profiles)\/[^\/]+)\/?/), false); }); };