abler-api 0.1.46 → 0.1.47
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.
- package/dist/cjs/pp-util.js +9 -3
- package/package.json +1 -1
package/dist/cjs/pp-util.js
CHANGED
|
@@ -50,7 +50,7 @@ class apiUtil$2 {
|
|
|
50
50
|
static testFlag = ppUtil$4.newGuid();
|
|
51
51
|
static envId_dev = "?";
|
|
52
52
|
static _validateBasicAuth = function (userName, password) {
|
|
53
|
-
throw new Error('
|
|
53
|
+
throw new Error('no basic auth validator');
|
|
54
54
|
}; // static apiCallRecSaver;
|
|
55
55
|
|
|
56
56
|
static config(appConfig, appErrCfg, appDbSql) {
|
|
@@ -1429,8 +1429,14 @@ class apiUtil$2 {
|
|
|
1429
1429
|
return res.sendStatus(401);
|
|
1430
1430
|
}
|
|
1431
1431
|
} catch (e) {
|
|
1432
|
-
|
|
1433
|
-
|
|
1432
|
+
if (e.statusCode === 401) {
|
|
1433
|
+
try {
|
|
1434
|
+
res.set('WWW-Authenticate', `Basic realm=${e.message}`);
|
|
1435
|
+
return res.sendStatus(401);
|
|
1436
|
+
} catch {}
|
|
1437
|
+
}
|
|
1438
|
+
|
|
1439
|
+
return res.send(err$2.ERROR(e));
|
|
1434
1440
|
}
|
|
1435
1441
|
|
|
1436
1442
|
return next();
|