@lobb-js/lobb-ext-auth 0.14.1 → 0.15.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.
@@ -30,10 +30,20 @@ export function getBaseWorkflows(_extensionConfig: ExtensionConfig): Workflow[]
30
30
  input.triggeredBy === "API" &&
31
31
  Number(input.id) === 1
32
32
  ) {
33
- throw new ctx.LobbError({
34
- code: "FORBIDDEN",
35
- message: "The admin user cannot be updated.",
36
- });
33
+ // Only the security-sensitive core fields are locked on the admin —
34
+ // changing them could lock out or hijack the account. Other fields
35
+ // (e.g. extension-added ones) are fine to update.
36
+ const protectedFields = ["email", "password", "role"];
37
+ const touched = Object.keys(input.data ?? {}).filter((field) =>
38
+ protectedFields.includes(field)
39
+ );
40
+ if (touched.length) {
41
+ throw new ctx.LobbError({
42
+ code: "FORBIDDEN",
43
+ message:
44
+ `The admin user's ${touched.join(", ")} cannot be updated.`,
45
+ });
46
+ }
37
47
  }
38
48
  },
39
49
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobb-js/lobb-ext-auth",
3
- "version": "0.14.1",
3
+ "version": "0.15.0",
4
4
  "license": "UNLICENSED",
5
5
  "type": "module",
6
6
  "publishConfig": {