mirror of
https://github.com/DoctorMcKay/node-steamcommunity.git
synced 2025-03-28 17:20:10 +08:00
Added support for app-based Steam Guard
This commit is contained in:
parent
80c0c3ebbc
commit
4f1f265c4d
6
index.js
6
index.js
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user