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 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 = yield ((_c = this.connectors[userResource.dataSource].getData({
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 = await this.connectors[userResource.dataSource].getData({
426
- resource: userResource,
427
- filters: [
428
- { field: this.config.auth.usernameField, operator: AdminForthFilterOperators.EQ, value: username },
429
- ],
430
- limit: 1,
431
- offset: 0,
432
- sort: [],
433
- }).data?.[0];
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' };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adminforth",
3
- "version": "1.0.72",
3
+ "version": "1.0.73",
4
4
  "description": "OpenSource Vue3 powered forth-generation admin panel",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",