Added Family View status to loggedIn method callback

This commit is contained in:
Alexander Corn 2015-07-17 21:19:43 -04:00
parent eaacef66bb
commit 12cffdd62c

View File

@ -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);
});
};