Fix infinite loop in getWebApiKey

Fix infinite loop in getWebApiKey when trying to get web api key on account without email address confirmed
This commit is contained in:
Arkadiusz Sygulski 2018-01-22 03:48:45 +01:00 committed by GitHub
parent 0ab3a94493
commit 0eb27a15d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -14,6 +14,10 @@ SteamCommunity.prototype.getWebApiKey = function(domain, callback) {
if(body.match(/<h2>Access Denied<\/h2>/)) {
return callback(new Error("Access Denied"));
}
if(body.match(/You must have a validated email address to create a Steam Web API key./)) {
return callback(new Error("You must have a validated email address to create a Steam Web API key."));
}
var match = body.match(/<p>Key: ([0-9A-F]+)<\/p>/);
if(match) {