mirror of
https://github.com/DoctorMcKay/node-steamcommunity.git
synced 2026-08-19 05:03:28 +08:00
Throw a descriptive error if accountName or password is missing in login
Closes #119
This commit is contained in:
6
index.js
6
index.js
@@ -56,7 +56,11 @@ function SteamCommunity(options) {
|
||||
}
|
||||
|
||||
SteamCommunity.prototype.login = function(details, callback) {
|
||||
if(details.steamguard) {
|
||||
if (!details.accountName || !details.password) {
|
||||
throw new Error("Missing either accountName or password to login; both are needed");
|
||||
}
|
||||
|
||||
if (details.steamguard) {
|
||||
var parts = details.steamguard.split('||');
|
||||
this._setCookie(Request.cookie('steamMachineAuth' + parts[0] + '=' + encodeURIComponent(parts[1])), true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user