mirror of
https://github.com/DoctorMcKay/node-steamcommunity.git
synced 2024-12-29 08:00:12 +08:00
Added Family View status to loggedIn method callback
This commit is contained in:
parent
eaacef66bb
commit
12cffdd62c
9
index.js
9
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);
|
||||
});
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user