badmfck-api-server 4.0.65 → 4.0.66
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -454,10 +454,10 @@ class MysqlAdapter {
|
|
|
454
454
|
const cres = await conn.query(this.prepareCountQuery(query));
|
|
455
455
|
if (cres && cres[0]) {
|
|
456
456
|
const res = cres[0];
|
|
457
|
-
if (Array.isArray(res) && res.length > 0 && "
|
|
458
|
-
total = res[0].
|
|
459
|
-
else if ("
|
|
460
|
-
total = res.
|
|
457
|
+
if (Array.isArray(res) && res.length > 0 && "count" in res[0])
|
|
458
|
+
total = res[0].count;
|
|
459
|
+
else if ("count" in res)
|
|
460
|
+
total = res.count;
|
|
461
461
|
}
|
|
462
462
|
}
|
|
463
463
|
this.lastSuccessQueryTime = +new Date();
|
|
@@ -132,7 +132,7 @@ class Monitor extends BaseEndpoint_1.BaseEndpoint {
|
|
|
132
132
|
async checkAuthentication(req) {
|
|
133
133
|
const users = await APIService_1.REQ_MONITOR_USERS.request();
|
|
134
134
|
if (!users || users.length == 0)
|
|
135
|
-
throw { ...DefaultErrors_1.default.UNAUTHORIZED, details: "No users found for
|
|
135
|
+
throw { ...DefaultErrors_1.default.UNAUTHORIZED, details: "No users found for monitor access, please set up users first." };
|
|
136
136
|
let header = req.headers['authorization'];
|
|
137
137
|
if (!header)
|
|
138
138
|
throw { ...DefaultErrors_1.default.UNAUTHORIZED, details: "No authorization header found" };
|