mirror of
https://github.com/DoctorMcKay/node-steamcommunity.git
synced 2025-03-24 06:00:07 +08:00
Removed attempt to get oauth token from webchat
This commit is contained in:
parent
2fc8d1f4aa
commit
e6311c0fcb
@ -49,25 +49,9 @@ SteamCommunity.prototype.getWebApiKey = function(domain, callback) {
|
||||
* @param {function} callback
|
||||
*/
|
||||
SteamCommunity.prototype.getWebApiOauthToken = function(callback) {
|
||||
var self = this;
|
||||
|
||||
if( this.oAuthToken ) {
|
||||
return callback( null, this.oAuthToken );
|
||||
if (this.oAuthToken) {
|
||||
return callback(null, this.oAuthToken);
|
||||
}
|
||||
|
||||
// Pull an oauth token from the webchat UI
|
||||
this.httpRequest("https://steamcommunity.com/chat", function(err, response, body) {
|
||||
if (err) {
|
||||
callback(err);
|
||||
return;
|
||||
}
|
||||
|
||||
var match = body.match(/"([0-9a-f]{32})"/);
|
||||
if (!match) {
|
||||
callback(new Error("Malformed response"));
|
||||
return;
|
||||
}
|
||||
|
||||
callback(null, match[1]);
|
||||
}, "steamcommunity");
|
||||
callback(new Error('This operation requires an OAuth token, which can only be obtained from node-steamcommunity\'s `login` method.'));
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user