@frigear-nu/users 1.2.5 → 1.3.0

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/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@frigear-nu/users",
3
3
  "configKey": "users",
4
- "version": "1.2.5",
4
+ "version": "1.3.0",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.3",
7
7
  "unbuild": "unknown"
@@ -27,6 +27,7 @@ export default defineEventHandler(async (event) => {
27
27
  }
28
28
  const [updated] = await db.update(schema.users).set({ email: normalizeUserEmail(claimed.newEmail), emailVerifiedAt: now }).where(eq(schema.users.id, claimed.userId)).returning();
29
29
  if (!updated) throw notFound("User not found.");
30
+ await notifyAuthCredentialsChanged({ userId: updated.id, reason: "email", event });
30
31
  await setUserSession(event, { user: mapUserToSession(updated) });
31
32
  const revertUrl = new URL(`/auth/revert-email-change?code=${claimed.revertCode}`, getRequestURL(event).origin).toString();
32
33
  await dispatchEmailNotification(buildEmailChangedNotification({
@@ -21,6 +21,7 @@ export default defineEventHandler(async (event) => {
21
21
  throw badRequest(EMAIL_REVERT_INVALID);
22
22
  }
23
23
  await db.update(schema.users).set({ email: normalizeUserEmail(claimed.oldEmail) }).where(eq(schema.users.id, claimed.userId));
24
+ await notifyAuthCredentialsChanged({ userId: claimed.userId, reason: "email", event });
24
25
  const session = await getUserSession(event);
25
26
  const signedOut = session.user?.id === claimed.userId;
26
27
  if (signedOut) await clearUserSession(event);
@@ -29,6 +29,7 @@ export default defineEventHandler(async (event) => {
29
29
  }
30
30
  const [updated] = await db.update(schema.users).set({ email }).where(eq(schema.users.id, user.id)).returning();
31
31
  if (!updated) throw notFound("User not found.");
32
+ await notifyAuthCredentialsChanged({ userId: updated.id, reason: "email", event });
32
33
  await setUserSession(event, { user: mapUserToSession(updated) });
33
34
  return { ...toProfileDto(updated), verificationRequired: false };
34
35
  });
@@ -20,6 +20,7 @@ export default defineEventHandler(async (event) => {
20
20
  const hashed = await hashPassword(newPassword);
21
21
  const [updated] = await db.update(schema.users).set({ password: hashed }).where(eq(schema.users.id, user.id)).returning();
22
22
  if (!updated) throw notFound("User not found.");
23
+ await notifyAuthCredentialsChanged({ userId: updated.id, reason: "password", event });
23
24
  await setUserSession(event, { user: mapUserToSession(updated) });
24
25
  await dispatchEmailNotification(buildPasswordChangedNotification({ to: updated.email, name: updated.name })).catch((error) => console.error("[@frigear-nu/users] Could not send the password changed notice.", error));
25
26
  return toProfileDto(updated);
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@frigear-nu/users",
3
- "version": "1.2.5",
3
+ "version": "1.3.0",
4
4
  "description": "The user entity for the main frigear app: the users table, admin user management and self-service profile, email and password changes. Sign-in lives in @frigear-nu/auth.",
5
5
  "homepage": "https://docs.frigear.dev/modules/identity/users",
6
6
  "repository": {
7
7
  "type": "git",
8
- "url": "git+https://github.com/frigear-nu/frigear-nu.git",
8
+ "url": "git+https://github.com/Frigear-nu/frigear-nu.git",
9
9
  "directory": "packages/users"
10
10
  },
11
11
  "license": "MIT",
@@ -34,11 +34,11 @@
34
34
  "playground"
35
35
  ],
36
36
  "dependencies": {
37
- "@frigear-nu/auth": "^0.3.1",
38
- "@frigear-nu/mcp": "^0.2.4",
39
- "@frigear-nu/module-kit": "^1.3.3",
40
- "@frigear-nu/notify": "^0.2.3",
41
- "@frigear-nu/ui": "^0.2.3",
37
+ "@frigear-nu/auth": "^0.3.4",
38
+ "@frigear-nu/mcp": "^0.2.5",
39
+ "@frigear-nu/module-kit": "^1.3.4",
40
+ "@frigear-nu/notify": "^0.2.4",
41
+ "@frigear-nu/ui": "^0.2.5",
42
42
  "@libsql/client": "^0.18.0",
43
43
  "@nuxt/kit": "^4.6.1",
44
44
  "drizzle-kit": "^0.31.11",
@@ -49,8 +49,8 @@
49
49
  "peerDependencies": {
50
50
  "@frigear-nu/admin": ">=0.0.0",
51
51
  "@frigear-nu/email-templates": "^0.1.0",
52
- "@frigear-nu/menu": "^0.2.3",
53
- "@frigear-nu/widget": "^0.2.3",
52
+ "@frigear-nu/menu": "^0.2.4",
53
+ "@frigear-nu/widget": "^0.2.4",
54
54
  "@nuxt/ui": "^4.12.0",
55
55
  "@nuxthub/core": "^0.10.8"
56
56
  },
@@ -73,10 +73,10 @@
73
73
  },
74
74
  "devDependencies": {
75
75
  "@electric-sql/pglite": "^0.5.9",
76
- "@frigear-nu/admin": "^0.2.3",
76
+ "@frigear-nu/admin": "^0.2.5",
77
77
  "@frigear-nu/email-templates": "^0.1.0",
78
- "@frigear-nu/menu": "^0.2.3",
79
- "@frigear-nu/widget": "^0.2.3",
78
+ "@frigear-nu/menu": "^0.2.4",
79
+ "@frigear-nu/widget": "^0.2.4",
80
80
  "@nuxt/devtools": "^3.4.2",
81
81
  "@nuxt/eslint-config": "^1.17.0",
82
82
  "@nuxt/module-builder": "^1.0.3",