@adminforth/email-invite 1.1.8 → 1.1.9

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
@@ -7,7 +7,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
- import AdminForth, { AdminForthPlugin, suggestIfTypo, Filters } from "adminforth";
10
+ import AdminForth, { AdminForthPlugin, suggestIfTypo, Filters, afLogger } from "adminforth";
11
11
  export default class EmailInvitePlugin extends AdminForthPlugin {
12
12
  constructor(options) {
13
13
  super(options, import.meta.url);
@@ -20,6 +20,9 @@ export default class EmailInvitePlugin extends AdminForthPlugin {
20
20
  });
21
21
  return __awaiter(this, void 0, void 0, function* () {
22
22
  _super.modifyResourceConfig.call(this, adminforth, resourceConfig);
23
+ if (!this.options.emailConfirmedField) {
24
+ afLogger.warn('emailConfirmedField is not set in EmailPasswordReset options. Invintation link can be re-user many times until for the 7d without any limits, so we recommend to setup this field to prevent security issues');
25
+ }
23
26
  if (!this.options.emailField) {
24
27
  throw new Error(`emailField is required and should be a name of field in auth resource`);
25
28
  }
package/index.ts CHANGED
@@ -1,4 +1,4 @@
1
- import AdminForth, { AdminForthPlugin, suggestIfTypo, Filters } from "adminforth";
1
+ import AdminForth, { AdminForthPlugin, suggestIfTypo, Filters, afLogger } from "adminforth";
2
2
  import type { IAdminForth, IHttpServer, AdminForthResourcePages, AdminForthResourceColumn, AdminForthDataTypes, AdminForthResource, AdminUser, HttpExtra } from "adminforth";
3
3
  import type { PluginOptions } from './types.js';
4
4
 
@@ -17,6 +17,10 @@ export default class EmailInvitePlugin extends AdminForthPlugin {
17
17
 
18
18
  async modifyResourceConfig(adminforth: IAdminForth, resourceConfig: AdminForthResource) {
19
19
  super.modifyResourceConfig(adminforth, resourceConfig);
20
+
21
+ if (!this.options.emailConfirmedField) {
22
+ afLogger.warn('emailConfirmedField is not set in EmailPasswordReset options. Invintation link can be re-user many times until for the 7d without any limits, so we recommend to setup this field to prevent security issues')
23
+ }
20
24
 
21
25
  if (!this.options.emailField) {
22
26
  throw new Error(`emailField is required and should be a name of field in auth resource`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adminforth/email-invite",
3
- "version": "1.1.8",
3
+ "version": "1.1.9",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",