@adminforth/email-invite 1.2.1 → 1.2.3

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
@@ -9,6 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  };
10
10
  import AdminForth, { AdminForthPlugin, suggestIfTypo, Filters, afLogger } from "adminforth";
11
11
  import { z } from "zod";
12
+ import { randomUUID } from "crypto";
12
13
  const setPasswordBodySchema = z.object({
13
14
  token: z.string(),
14
15
  password: z.string(),
@@ -127,7 +128,7 @@ export default class EmailInvitePlugin extends AdminForthPlugin {
127
128
  delete record.password;
128
129
  }
129
130
  const passwordHashFieldName = adminforth.config.auth.passwordHashField;
130
- record[passwordHashFieldName] = yield AdminForth.Utils.generatePasswordHash('TEMP_INVITE_PLACEHOLDER_' + Date.now());
131
+ record[passwordHashFieldName] = yield AdminForth.Utils.generatePasswordHash('TEMP_INVITE_PLACEHOLDER_' + randomUUID());
131
132
  if (this.options.emailConfirmedField && this.emailConfirmedField) {
132
133
  record[this.emailConfirmedField.name] = false;
133
134
  }
package/index.ts CHANGED
@@ -2,6 +2,7 @@ import AdminForth, { AdminForthPlugin, suggestIfTypo, Filters, afLogger } from "
2
2
  import type { IAdminForth, IHttpServer, AdminForthResourcePages, AdminForthResourceColumn, AdminForthDataTypes, AdminForthResource, AdminUser, HttpExtra } from "adminforth";
3
3
  import type { PluginOptions } from './types.js';
4
4
  import { z } from "zod";
5
+ import { randomUUID } from "crypto";
5
6
 
6
7
  const setPasswordBodySchema = z.object({
7
8
  token: z.string(),
@@ -151,7 +152,7 @@ export default class EmailInvitePlugin extends AdminForthPlugin {
151
152
  }
152
153
 
153
154
  const passwordHashFieldName = adminforth.config.auth!.passwordHashField;
154
- record[passwordHashFieldName] = await AdminForth.Utils.generatePasswordHash('TEMP_INVITE_PLACEHOLDER_' + Date.now());
155
+ record[passwordHashFieldName] = await AdminForth.Utils.generatePasswordHash('TEMP_INVITE_PLACEHOLDER_' + randomUUID());
155
156
 
156
157
  if (this.options.emailConfirmedField && this.emailConfirmedField) {
157
158
  record[this.emailConfirmedField.name] = false;
package/package.json CHANGED
@@ -1,10 +1,14 @@
1
1
  {
2
2
  "name": "@adminforth/email-invite",
3
- "version": "1.2.1",
3
+ "version": "1.2.3",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",
7
7
  "homepage": "https://adminforth.dev/docs/tutorial/Plugins/email-invite/",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "https://github.com/devforth/adminforth-email-invite.git"
11
+ },
8
12
  "scripts": {
9
13
  "build": "tsc && rsync -av --exclude 'node_modules' custom dist/"
10
14
  },