diff --git a/components/confirmations.js b/components/confirmations.js index 3262020..93f4861 100644 --- a/components/confirmations.js +++ b/components/confirmations.js @@ -12,10 +12,10 @@ const CConfirmation = require('../classes/CConfirmation.js'); * @param {SteamCommunity~getConfirmations} callback - Called when the list of confirmations is received */ SteamCommunity.prototype.getConfirmations = function(time, key, callback) { - request(this, "conf", key, time, "conf", null, false, (err, body) => { + request(this, 'conf', key, time, 'conf', null, false, (err, body) => { if (err) { - if (err.message == "Invalid protocol: steammobile:") { - err.message = "Not Logged In"; + if (err.message == 'Invalid protocol: steammobile:') { + err.message = 'Not Logged In'; this._notifySessionExpired(err); } @@ -39,7 +39,7 @@ SteamCommunity.prototype.getConfirmations = function(time, key, callback) { // We have something to confirm let confirmations = $('#mobileconf_list'); if (!confirmations) { - callback(new Error("Malformed response")); + callback(new Error('Malformed response')); return; } @@ -49,14 +49,14 @@ SteamCommunity.prototype.getConfirmations = function(time, key, callback) { let img = conf.find('.mobileconf_list_entry_icon img'); confs.push(new CConfirmation(this, { - "id": conf.data('confid'), - "type": conf.data('type'), - "creator": conf.data('creator'), - "key": conf.data('key'), - "title": conf.find('.mobileconf_list_entry_description>div:nth-of-type(1)').text().trim(), - "receiving": conf.find('.mobileconf_list_entry_description>div:nth-of-type(2)').text().trim(), - "time": conf.find('.mobileconf_list_entry_description>div:nth-of-type(3)').text().trim(), - "icon": img.length < 1 ? '' : $(img).attr('src') + id: conf.data('confid'), + type: conf.data('type'), + creator: conf.data('creator'), + key: conf.data('key'), + title: conf.find('.mobileconf_list_entry_description>div:nth-of-type(1)').text().trim(), + receiving: conf.find('.mobileconf_list_entry_description>div:nth-of-type(2)').text().trim(), + time: conf.find('.mobileconf_list_entry_description>div:nth-of-type(3)').text().trim(), + icon: img.length < 1 ? '' : $(img).attr('src') })); }); @@ -78,14 +78,14 @@ SteamCommunity.prototype.getConfirmations = function(time, key, callback) { * @param {SteamCommunity~getConfirmationOfferID} callback */ SteamCommunity.prototype.getConfirmationOfferID = function(confID, time, key, callback) { - request(this, "details/" + confID, key, time, "details", null, true, (err, body) => { + request(this, 'details/' + confID, key, time, 'details', null, true, (err, body) => { if (err) { callback(err); return; } if (!body.success) { - callback(new Error("Cannot load confirmation details")); + callback(new Error('Cannot load confirmation details')); return; } @@ -116,10 +116,10 @@ SteamCommunity.prototype.getConfirmationOfferID = function(confID, time, key, ca * @param {SteamCommunity~genericErrorCallback} callback - Called when the request is complete */ SteamCommunity.prototype.respondToConfirmation = function(confID, confKey, time, key, accept, callback) { - request(this, (confID instanceof Array) ? "multiajaxop" : "ajaxop", key, time, accept ? "allow" : "cancel", { - "op": accept ? "allow" : "cancel", - "cid": confID, - "ck": confKey + request(this, (confID instanceof Array) ? 'multiajaxop' : 'ajaxop', key, time, accept ? 'allow' : 'cancel', { + op: accept ? 'allow' : 'cancel', + cid: confID, + ck: confKey }, true, (err, body) => { if (!callback) { return; @@ -140,7 +140,7 @@ SteamCommunity.prototype.respondToConfirmation = function(confID, confKey, time, return; } - callback(new Error("Could not act on confirmation")); + callback(new Error('Could not act on confirmation')); }); }; @@ -156,7 +156,7 @@ SteamCommunity.prototype.acceptConfirmationForObject = function(identitySecret, let doConfirmation = () => { let offset = this._timeOffset; let time = SteamTotp.time(offset); - this.getConfirmations(time, SteamTotp.getConfirmationKey(identitySecret, time, "conf"), (err, confs) => { + this.getConfirmations(time, SteamTotp.getConfirmationKey(identitySecret, time, 'conf'), (err, confs) => { if (err) { callback(err); return; @@ -164,7 +164,7 @@ SteamCommunity.prototype.acceptConfirmationForObject = function(identitySecret, let conf = confs.find(conf => conf.creator == objectID); if (!conf) { - callback(new Error("Could not find confirmation for object " + objectID)); + callback(new Error('Could not find confirmation for object ' + objectID)); return; } @@ -179,7 +179,7 @@ SteamCommunity.prototype.acceptConfirmationForObject = function(identitySecret, this._usedConfTimes.splice(0, this._usedConfTimes.length - 60); // we don't need to save more than 60 entries } - conf.respond(time, SteamTotp.getConfirmationKey(identitySecret, time, "allow"), true, callback); + conf.respond(time, SteamTotp.getConfirmationKey(identitySecret, time, 'allow'), true, callback); }); }; @@ -239,7 +239,7 @@ SteamCommunity.prototype.acceptAllConfirmations = function(time, confKey, allowK function request(community, url, key, time, tag, params, json, callback) { if (!community.steamID) { - throw new Error("Must be logged in before trying to do anything with confirmations"); + throw new Error('Must be logged in before trying to do anything with confirmations'); } params = params || {}; @@ -247,16 +247,16 @@ function request(community, url, key, time, tag, params, json, callback) { params.a = community.steamID.getSteamID64(); params.k = key; params.t = time; - params.m = "android"; + params.m = 'android'; params.tag = tag; let req = { - "method": url == 'multiajaxop' ? 'POST' : 'GET', - "uri": "https://steamcommunity.com/mobileconf/" + url, - "json": !!json + method: url == 'multiajaxop' ? 'POST' : 'GET', + uri: 'https://steamcommunity.com/mobileconf/' + url, + json: !!json }; - if (req.method == "GET") { + if (req.method == 'GET') { req.qs = params; } else { req.form = params; diff --git a/components/groups.js b/components/groups.js index 410d1a6..6a1c1ba 100644 --- a/components/groups.js +++ b/components/groups.js @@ -13,18 +13,18 @@ SteamCommunity.prototype.getGroupMembers = function(gid, callback, members, link if (!link) { if (typeof gid != 'string') { // It's a SteamID object - link = "https://steamcommunity.com/gid/" + gid.toString() + "/memberslistxml/?xml=1"; + link = `https://steamcommunity.com/gid/${gid.toString()}/memberslistxml/?xml=1`; } else { try { // new SteamID could throw which is why we have this funky-looking try/catch set up here let sid = new SteamID(gid); if (sid.type == SteamID.Type.CLAN && sid.isValid()) { - link = "https://steamcommunity.com/gid/" + sid.getSteamID64() + "/memberslistxml/?xml=1"; + link = `https://steamcommunity.com/gid/${sid.getSteamID64()}/memberslistxml/?xml=1`; } else { - throw new Error("Doesn't particularly matter what this message is"); + throw new Error('Doesn\'t particularly matter what this message is'); } } catch (e) { - link = "http://steamcommunity.com/groups/" + gid + "/memberslistxml/?xml=1"; + link = `http://steamcommunity.com/groups/${gid}/memberslistxml/?xml=1`; } } } @@ -76,10 +76,10 @@ SteamCommunity.prototype.joinGroup = function(gid, callback) { } this.httpRequestPost({ - "uri": "https://steamcommunity.com/gid/" + gid.getSteamID64(), - "form": { - "action": "join", - "sessionID": this.getSessionID() + uri: `https://steamcommunity.com/gid/${gid.getSteamID64()}`, + form: { + action: 'join', + sessionID: this.getSessionID() } }, (err, response, body) => { if (!callback) { @@ -95,10 +95,10 @@ SteamCommunity.prototype.leaveGroup = function(gid, callback) { gid = new SteamID(gid); } - this._myProfile("home_process", { - "sessionID": this.getSessionID(), - "action": "leaveGroup", - "groupId": gid.getSteamID64() + this._myProfile('home_process', { + sessionID: this.getSessionID(), + action: 'leaveGroup', + groupId: gid.getSteamID64() }, (err, response, body) => { if (!callback) { return; @@ -119,7 +119,7 @@ SteamCommunity.prototype.getAllGroupAnnouncements = function(gid, time, callback } this.httpRequest({ - "uri": "https://steamcommunity.com/gid/" + gid.getSteamID64() + "/rss/" + uri: `https://steamcommunity.com/gid/${gid.getSteamID64()}/rss/` }, (err, response, body) => { if (err) { callback(err); @@ -162,23 +162,23 @@ SteamCommunity.prototype.postGroupAnnouncement = function(gid, headline, content } let form = { - "sessionID": this.getSessionID(), - "action": "post", - "headline": headline, - "body": content, - "languages[0][headline]": headline, - "languages[0][body]": content + sessionID: this.getSessionID(), + action: 'post', + headline: headline, + body: content, + 'languages[0][headline]': headline, + 'languages[0][body]': content }; if (hidden) { - form.is_hidden = "is_hidden" + form.is_hidden = 'is_hidden' } this.httpRequestPost({ - "uri": "https://steamcommunity.com/gid/" + gid.getSteamID64() + "/announcements", + uri: `https://steamcommunity.com/gid/${gid.getSteamID64()}/announcements`, form }, (err, response, body) => { - if(!callback) { + if (!callback) { return; } @@ -192,16 +192,16 @@ SteamCommunity.prototype.editGroupAnnouncement = function(gid, aid, headline, co } let submitData = { - "uri": "https://steamcommunity.com/gid/" + gid.getSteamID64() + "/announcements", - "form": { - "sessionID": this.getSessionID(), - "gid": aid, - "action": "update", - "headline": headline, - "body": content, - "languages[0][headline]": headline, - "languages[0][body]": content, - "languages[0][updated]": 1 + uri: `https://steamcommunity.com/gid/${gid.getSteamID64()}/announcements`, + form: { + sessionID: this.getSessionID(), + gid: aid, + action: 'update', + headline: headline, + body: content, + 'languages[0][headline]': headline, + 'languages[0][body]': content, + 'languages[0][updated]': 1 } }; @@ -220,7 +220,7 @@ SteamCommunity.prototype.deleteGroupAnnouncement = function(gid, aid, callback) } let submitData = { - "uri": "https://steamcommunity.com/gid/" + gid.getSteamID64() + "/announcements/delete/" + aid + "?sessionID=" + this.getSessionID() + uri: `https://steamcommunity.com/gid/${gid.getSteamID64()}/announcements/delete/${aid}?sessionID=${this.getSessionID()}` }; this.httpRequestGet(submitData, (err, response, body) => { @@ -257,16 +257,16 @@ SteamCommunity.prototype.scheduleGroupEvent = function(gid, name, type, descript } let form = { - "sessionid": this.getSessionID(), - "action": "newEvent", - "tzOffset": new Date().getTimezoneOffset() * -60, - "name": name, - "type": (typeof type == 'number' || !isNaN(parseInt(type, 10)) ? "GameEvent" : type), - "appID": (typeof type == 'number' || !isNaN(parseInt(type, 10)) ? type : ''), - "serverIP": server.ip, - "serverPassword": server.password, - "notes": description, - "eventQuickTime": "now" + sessionid: this.getSessionID(), + action: 'newEvent', + tzOffset: new Date().getTimezoneOffset() * -60, + name: name, + type: (typeof type == 'number' || !isNaN(parseInt(type, 10)) ? 'GameEvent' : type), + appID: (typeof type == 'number' || !isNaN(parseInt(type, 10)) ? type : ''), + serverIP: server.ip, + serverPassword: server.password, + notes: description, + eventQuickTime: 'now' }; if (time === null) { @@ -284,7 +284,7 @@ SteamCommunity.prototype.scheduleGroupEvent = function(gid, name, type, descript } this.httpRequestPost({ - "uri": "https://steamcommunity.com/gid/" + gid.toString() + "/eventEdit", + uri: `https://steamcommunity.com/gid/${gid.toString()}/eventEdit`, form }, (err, response, body) => { if (!callback) { @@ -320,17 +320,17 @@ SteamCommunity.prototype.editGroupEvent = function(gid, id, name, type, descript } let form = { - "sessionid": this.getSessionID(), - "action": "updateEvent", - "eventID": id, - "tzOffset": new Date().getTimezoneOffset() * -60, - "name": name, - "type": (typeof type == 'number' || !isNaN(parseInt(type, 10)) ? "GameEvent" : type), - "appID": (typeof type == 'number' || !isNaN(parseInt(type, 10)) ? type : ''), - "serverIP": server.ip, - "serverPassword": server.password, - "notes": description, - "eventQuickTime": "now" + sessionid: this.getSessionID(), + action: 'updateEvent', + eventID: id, + tzOffset: new Date().getTimezoneOffset() * -60, + name: name, + type: (typeof type == 'number' || !isNaN(parseInt(type, 10)) ? 'GameEvent' : type), + appID: (typeof type == 'number' || !isNaN(parseInt(type, 10)) ? type : ''), + serverIP: server.ip, + serverPassword: server.password, + notes: description, + eventQuickTime: 'now' }; if (time === null) { @@ -348,8 +348,8 @@ SteamCommunity.prototype.editGroupEvent = function(gid, id, name, type, descript } this.httpRequestPost({ - "uri": "https://steamcommunity.com/gid/" + gid.toString() + "/eventEdit", - "form": form + uri: `https://steamcommunity.com/gid/${gid.toString()}/eventEdit`, + form }, (err, response, body) => { if (!callback) { return; @@ -365,13 +365,13 @@ SteamCommunity.prototype.deleteGroupEvent = function(gid, id, callback) { } let form = { - "sessionid": this.getSessionID(), - "action": "deleteEvent", - "eventID": id + sessionid: this.getSessionID(), + action: 'deleteEvent', + eventID: id }; this.httpRequestPost({ - "uri": "https://steamcommunity.com/gid/" + gid.toString() + "/eventEdit", + uri: `https://steamcommunity.com/gid/${gid.toString()}/eventEdit`, form }, (err, response, body) => { if (!callback) { @@ -392,12 +392,12 @@ SteamCommunity.prototype.setGroupPlayerOfTheWeek = function(gid, steamID, callba } this.httpRequestPost({ - "uri": "https://steamcommunity.com/gid/" + gid.getSteamID64() + "/potwEdit", - "form": { - "xml": 1, - "action": "potw", - "memberId": steamID.getSteam3RenderedID(), - "sessionid": this.getSessionID() + uri: `https://steamcommunity.com/gid/${gid.getSteamID64()}/potwEdit`, + form: { + xml: 1, + action: 'potw', + memberId: steamID.getSteam3RenderedID(), + sessionid: this.getSessionID() } }, (err, response, body) => { if (!callback) { @@ -405,7 +405,7 @@ SteamCommunity.prototype.setGroupPlayerOfTheWeek = function(gid, steamID, callba } if (err || response.statusCode != 200) { - callback(err || new Error("HTTP error " + response.statusCode)); + callback(err || new Error(`HTTP error ${response.statusCode}`)); return; } @@ -434,12 +434,12 @@ SteamCommunity.prototype.kickGroupMember = function(gid, steamID, callback) { } this.httpRequestPost({ - "uri": "https://steamcommunity.com/gid/" + gid.getSteamID64() + "/membersManage", - "form": { - "sessionID": this.getSessionID(), - "action": "kick", - "memberId": steamID.getSteamID64(), - "queryString": "" + uri: `https://steamcommunity.com/gid/${gid.getSteamID64()}/membersManage`, + form: { + sessionID: this.getSessionID(), + action: 'kick', + memberId: steamID.getSteamID64(), + queryString: '' } }, (err, response, body) => { if (!callback) { @@ -460,7 +460,7 @@ SteamCommunity.prototype.getGroupHistory = function(gid, page, callback) { page = 1; } - this.httpRequest("https://steamcommunity.com/gid/" + gid.getSteamID64() + "/history?p=" + page, (err, response, body) => { + this.httpRequest(`https://steamcommunity.com/gid/${gid.getSteamID64()}/history?p=${page}`, (err, response, body) => { if (err) { callback(err); return; @@ -535,10 +535,10 @@ SteamCommunity.prototype.getAllGroupComments = function(gid, from, count, callba } let options = { - "uri": "https://steamcommunity.com/comment/Clan/render/" + gid.getSteamID64() + "/-1/", - "form": { - "start": from, - "count": count + uri: `https://steamcommunity.com/comment/Clan/render/${gid.getSteamID64()}/-1/`, + form: { + start: from, + count } }; @@ -555,13 +555,13 @@ SteamCommunity.prototype.getAllGroupComments = function(gid, from, count, callba $('.commentthread_comment_content').each(function() { let comment = {}; - let $selector = $(this).find(".commentthread_author_link"); - comment.authorName = $($selector).find("bdi").text(); - comment.authorId = $($selector).attr("href").replace(/https?:\/\/steamcommunity.com\/(id|profiles)\//, ""); - comment.date = Helpers.decodeSteamTime($(this).find(".commentthread_comment_timestamp").text().trim()); + let $selector = $(this).find('.commentthread_author_link'); + comment.authorName = $($selector).find('bdi').text(); + comment.authorId = $($selector).attr('href').replace(/https?:\/\/steamcommunity.com\/(id|profiles)\//, ''); + comment.date = Helpers.decodeSteamTime($(this).find('.commentthread_comment_timestamp').text().trim()); - $selector = $(this).find(".commentthread_comment_text"); - comment.commentId = $($selector).attr("id").replace("comment_content_", ""); + $selector = $(this).find('.commentthread_comment_text'); + comment.commentId = $($selector).attr('id').replace('comment_content_', ''); comment.text = $($selector).html().trim(); comments.push(comment); @@ -581,10 +581,10 @@ SteamCommunity.prototype.deleteGroupComment = function(gid, cid, callback) { } let options = { - "uri": "https://steamcommunity.com/comment/Clan/delete/" + gid.getSteamID64() + "/-1/", - "form": { - "sessionid": this.getSessionID(), - "gidcomment": cid + uri: `https://steamcommunity.com/comment/Clan/delete/${gid.getSteamID64()}/-1/`, + form: { + sessionid: this.getSessionID(), + gidcomment: cid } }; @@ -603,11 +603,11 @@ SteamCommunity.prototype.postGroupComment = function(gid, message, callback) { } let options = { - "uri": "https://steamcommunity.com/comment/Clan/post/" + gid.getSteamID64() + "/-1/", - "form": { - "comment": message, - "count": 6, - "sessionid": this.getSessionID() + uri: `https://steamcommunity.com/comment/Clan/post/${gid.getSteamID64()}/-1/`, + form: { + comment: message, + count: 6, + sessionid: this.getSessionID() } }; @@ -630,9 +630,9 @@ SteamCommunity.prototype.getGroupJoinRequests = function(gid, callback) { gid = new SteamID(gid); } - this.httpRequestGet("https://steamcommunity.com/gid/" + gid.getSteamID64() + "/joinRequestsManage", (err, res, body) => { + this.httpRequestGet(`https://steamcommunity.com/gid/${gid.getSteamID64()}/joinRequestsManage`, (err, res, body) => { if (!body) { - callback(new Error("Malformed response")); + callback(new Error('Malformed response')); return; } @@ -645,7 +645,7 @@ SteamCommunity.prototype.getGroupJoinRequests = function(gid, callback) { let requests = []; for (let i = 0; i < matches.length; i++) { - requests.push(new SteamID("[U:1:" + matches[i].match(/JoinRequests_ApproveDenyUser\(\W*['"](\d+)['"],\W0\W\)/)[1] + "]")); + requests.push(new SteamID('[U:1:' + matches[i].match(/JoinRequests_ApproveDenyUser\(\W*['"](\d+)['"],\W0\W\)/)[1] + ']')); } callback(null, requests); @@ -667,21 +667,21 @@ SteamCommunity.prototype.respondToGroupJoinRequests = function(gid, steamIDs, ap let rgAccounts = (!Array.isArray(steamIDs) ? [steamIDs] : steamIDs).map(sid => sid.toString()); this.httpRequestPost({ - "uri": "https://steamcommunity.com/gid/" + gid.getSteamID64() + "/joinRequestsManage", - "form": { - "rgAccounts": rgAccounts, - "bapprove": approve ? "1" : "0", - "json": "1", - "sessionID": this.getSessionID() + uri: `https://steamcommunity.com/gid/${gid.getSteamID64()}/joinRequestsManage`, + form: { + rgAccounts: rgAccounts, + bapprove: approve ? '1' : '0', + json: '1', + sessionID: this.getSessionID() }, - "json": true + json: true }, (err, res, body) => { if (!callback) { return; } if (body != EResult.OK) { - let err = new Error(EResult[body] || ("Error " + body)); + let err = new Error(EResult[body] || `Error ${body}`); err.eresult = body; callback(err); } else { @@ -702,21 +702,21 @@ SteamCommunity.prototype.respondToAllGroupJoinRequests = function(gid, approve, } this.httpRequestPost({ - "uri": "https://steamcommunity.com/gid/" + gid.getSteamID64() + "/joinRequestsManage", - "form": { - "bapprove": approve ? "1" : "0", - "json": "1", - "action": "bulkrespond", - "sessionID": this.getSessionID() + uri: `https://steamcommunity.com/gid/${gid.getSteamID64()}/joinRequestsManage`, + form: { + bapprove: approve ? '1' : '0', + json: '1', + action: 'bulkrespond', + sessionID: this.getSessionID() }, - "json": true + json: true }, (err, res, body) => { if (!callback) { return; } if (body != EResult.OK) { - let err = new Error(EResult[body] || ("Error " + body)); + let err = new Error(EResult[body] || `Error ${body}`); err.eresult = body; callback(err); } else { diff --git a/components/http.js b/components/http.js index 5911211..5898f82 100644 --- a/components/http.js +++ b/components/http.js @@ -44,14 +44,14 @@ SteamCommunity.prototype.httpRequest = function(uri, options, callback, source) let httpError = options.checkHttpError !== false && this._checkHttpError(err, response, callback, body); let communityError = !options.json && options.checkCommunityError !== false && this._checkCommunityError(body, httpError ? noop : callback); // don't fire the callback if hasHttpError did it already let tradeError = !options.json && options.checkTradeError !== false && this._checkTradeError(body, httpError || communityError ? noop : callback); // don't fire the callback if either of the previous already did - let jsonError = options.json && options.checkJsonError !== false && !body ? new Error("Malformed JSON response") : null; + let jsonError = options.json && options.checkJsonError !== false && !body ? new Error('Malformed JSON response') : null; this.emit('postHttpRequest', requestID, source, options, httpError || communityError || tradeError || jsonError || null, response, body, { - "hasCallback": hasCallback, - "httpError": httpError, - "communityError": communityError, - "tradeError": tradeError, - "jsonError": jsonError + hasCallback, + httpError, + communityError, + tradeError, + jsonError }); if (hasCallback && !(httpError || communityError || tradeError)) { @@ -71,12 +71,12 @@ SteamCommunity.prototype.httpRequest = function(uri, options, callback, source) }; SteamCommunity.prototype.httpRequestGet = function() { - this._httpRequestConvenienceMethod = "GET"; + this._httpRequestConvenienceMethod = 'GET'; return this.httpRequest.apply(this, arguments); }; SteamCommunity.prototype.httpRequestPost = function() { - this._httpRequestConvenienceMethod = "POST"; + this._httpRequestConvenienceMethod = 'POST'; return this.httpRequest.apply(this, arguments); }; @@ -91,20 +91,20 @@ SteamCommunity.prototype._checkHttpError = function(err, response, callback, bod } if (response.statusCode >= 300 && response.statusCode <= 399 && response.headers.location.indexOf('/login') != -1) { - err = new Error("Not Logged In"); + err = new Error('Not Logged In'); callback(err, response, body); this._notifySessionExpired(err); return err; } if (response.statusCode == 403 && typeof response.body == 'string' && response.body.match(/
Enter your PIN below to exit Family View.<\/div>/)) { - err = new Error("Family View Restricted"); + err = new Error('Family View Restricted'); callback(err, response, body); return err; } if (response.statusCode >= 400) { - err = new Error("HTTP error " + response.statusCode); + err = new Error(`HTTP error ${response.statusCode}`); err.code = response.statusCode; callback(err, response, body); return err; @@ -118,13 +118,13 @@ SteamCommunity.prototype._checkCommunityError = function(html, callback) { if (typeof html == 'string' && html.match(/

Sorry!<\/h1>/)) { let match = html.match(/

(.+)<\/h3>/); - err = new Error(match ? match[1] : "Unknown error occurred"); + err = new Error(match ? match[1] : 'Unknown error occurred'); callback(err); return err; } if (typeof html == 'string' && html.match(/g_steamID = false;/) && html.match(/

Sign In<\/h1>/)) { - err = new Error("Not Logged In"); + err = new Error('Not Logged In'); callback(err); this._notifySessionExpired(err); return err;