mirror of
https://github.com/DoctorMcKay/node-steamcommunity.git
synced 2026-08-21 14:13:28 +08:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
911ae86379 | ||
|
|
a12e8cb67c | ||
|
|
edd95cc93f | ||
|
|
4f1f265c4d |
8
index.js
8
index.js
@@ -12,7 +12,7 @@ SteamCommunity.SteamID = SteamID;
|
||||
function SteamCommunity() {
|
||||
this._jar = Request.jar();
|
||||
this._captchaGid = -1;
|
||||
this.request = Request.defaults({"jar": this._jar});
|
||||
this.request = Request.defaults({"jar": this._jar, "timeout": 50000});
|
||||
this.chatState = SteamCommunity.ChatState.Offline;
|
||||
|
||||
// English
|
||||
@@ -52,7 +52,7 @@ SteamCommunity.prototype.login = function(details, callback) {
|
||||
"password": hex2b64(key.encrypt(details.password)),
|
||||
"remember_login": "true",
|
||||
"rsatimestamp": json.timestamp,
|
||||
"twofactorcode": "",
|
||||
"twofactorcode": details.twoFactorCode || "",
|
||||
"username": details.accountName
|
||||
};
|
||||
|
||||
@@ -66,10 +66,14 @@ SteamCommunity.prototype.login = function(details, callback) {
|
||||
}
|
||||
|
||||
if(!body.success && body.emailauth_needed) {
|
||||
// Steam Guard (email)
|
||||
var error = new Error("SteamGuard");
|
||||
error.emaildomain = body.emaildomain;
|
||||
|
||||
callback(error);
|
||||
} else if(!body.success && body.requires_twofactor) {
|
||||
// Steam Guard (app)
|
||||
callback(new Error("SteamGuardMobile"));
|
||||
} else if(!body.success && body.captcha_needed) {
|
||||
var error = new Error("CAPTCHA");
|
||||
error.captchaurl = "https://steamcommunity.com/public/captcha.php?gid=" + body.captcha_gid;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "steamcommunity",
|
||||
"version": "3.0.0",
|
||||
"version": "3.1.1",
|
||||
"description": "Provides an interface for logging into and interacting with the Steam Community website",
|
||||
"keywords": ["steam", "steam community"],
|
||||
"homepage": "https://github.com/DoctorMcKay/node-steamcommunity",
|
||||
|
||||
Reference in New Issue
Block a user