adminforth 1.0.72 → 1.0.73
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/index.js +2 -2
- package/index.ts +11 -9
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -356,7 +356,7 @@ class AdminForth {
|
|
|
356
356
|
throw new Error('No config.auth defined');
|
|
357
357
|
}
|
|
358
358
|
const userResource = this.config.resources.find((res) => res.resourceId === this.config.auth.resourceId);
|
|
359
|
-
const userRecord =
|
|
359
|
+
const userRecord = (_c = (yield this.connectors[userResource.dataSource].getData({
|
|
360
360
|
resource: userResource,
|
|
361
361
|
filters: [
|
|
362
362
|
{ field: this.config.auth.usernameField, operator: AdminForthFilterOperators.EQ, value: username },
|
|
@@ -364,7 +364,7 @@ class AdminForth {
|
|
|
364
364
|
limit: 1,
|
|
365
365
|
offset: 0,
|
|
366
366
|
sort: [],
|
|
367
|
-
}).data) === null || _c === void 0 ? void 0 : _c[0]
|
|
367
|
+
})).data) === null || _c === void 0 ? void 0 : _c[0];
|
|
368
368
|
if (!userRecord) {
|
|
369
369
|
return { error: 'User not found' };
|
|
370
370
|
}
|
package/index.ts
CHANGED
|
@@ -422,15 +422,17 @@ class AdminForth {
|
|
|
422
422
|
throw new Error('No config.auth defined');
|
|
423
423
|
}
|
|
424
424
|
const userResource = this.config.resources.find((res) => res.resourceId === this.config.auth.resourceId);
|
|
425
|
-
const userRecord =
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
425
|
+
const userRecord = (
|
|
426
|
+
await this.connectors[userResource.dataSource].getData({
|
|
427
|
+
resource: userResource,
|
|
428
|
+
filters: [
|
|
429
|
+
{ field: this.config.auth.usernameField, operator: AdminForthFilterOperators.EQ, value: username },
|
|
430
|
+
],
|
|
431
|
+
limit: 1,
|
|
432
|
+
offset: 0,
|
|
433
|
+
sort: [],
|
|
434
|
+
})
|
|
435
|
+
).data?.[0];
|
|
434
436
|
|
|
435
437
|
if (!userRecord) {
|
|
436
438
|
return { error: 'User not found' };
|