@camstack/core 0.1.35 → 0.1.36
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/builtins/local-auth/local-auth.addon.d.ts.map +1 -1
- package/dist/builtins/local-auth/local-auth.addon.js +21 -3
- package/dist/builtins/local-auth/local-auth.addon.js.map +1 -1
- package/dist/builtins/local-auth/local-auth.addon.mjs +21 -3
- package/dist/builtins/local-auth/local-auth.addon.mjs.map +1 -1
- package/dist/builtins/mesh-orchestrator/mesh-orchestrator.addon.d.ts.map +1 -1
- package/dist/builtins/mesh-orchestrator/mesh-orchestrator.addon.js +32 -1
- package/dist/builtins/mesh-orchestrator/mesh-orchestrator.addon.js.map +1 -1
- package/dist/builtins/mesh-orchestrator/mesh-orchestrator.addon.mjs +32 -1
- package/dist/builtins/mesh-orchestrator/mesh-orchestrator.addon.mjs.map +1 -1
- package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.d.ts.map +1 -1
- package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +16 -0
- package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js.map +1 -1
- package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +16 -0
- package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs.map +1 -1
- package/dist/index.js +95 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +95 -8
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -7778,12 +7778,24 @@ var LocalAuthAddon = class extends BaseAddon {
|
|
|
7778
7778
|
const userMgmt = {
|
|
7779
7779
|
listUsers: async () => {
|
|
7780
7780
|
if (!this.userManager) return [];
|
|
7781
|
-
|
|
7781
|
+
const users = await this.userManager.listAll();
|
|
7782
|
+
if (!this.totpManager) return users.map((u) => ({
|
|
7783
|
+
...u,
|
|
7784
|
+
totpEnabled: false
|
|
7785
|
+
}));
|
|
7786
|
+
const statuses = await Promise.all(users.map((u) => this.totpManager.getStatus(u.id).catch(() => ({ enabled: false }))));
|
|
7787
|
+
return users.map((u, i) => ({
|
|
7788
|
+
...u,
|
|
7789
|
+
totpEnabled: statuses[i]?.enabled ?? false
|
|
7790
|
+
}));
|
|
7782
7791
|
},
|
|
7783
7792
|
createUser: async (input) => {
|
|
7784
7793
|
if (!this.userManager) throw new Error("User management not available");
|
|
7785
7794
|
const { passwordHash: _, ...summary } = await this.userManager.create(input);
|
|
7786
|
-
return
|
|
7795
|
+
return {
|
|
7796
|
+
...summary,
|
|
7797
|
+
totpEnabled: false
|
|
7798
|
+
};
|
|
7787
7799
|
},
|
|
7788
7800
|
updateUser: async (input) => {
|
|
7789
7801
|
if (!this.userManager) throw new Error("User management not available");
|
|
@@ -7808,7 +7820,13 @@ var LocalAuthAddon = class extends BaseAddon {
|
|
|
7808
7820
|
},
|
|
7809
7821
|
validateCredentials: async (input) => {
|
|
7810
7822
|
if (!this.userManager) return null;
|
|
7811
|
-
|
|
7823
|
+
const user = await this.userManager.validateCredentials(input.username, input.password);
|
|
7824
|
+
if (!user) return null;
|
|
7825
|
+
const totpEnabled = this.totpManager ? (await this.totpManager.getStatus(user.id).catch(() => ({ enabled: false }))).enabled : false;
|
|
7826
|
+
return {
|
|
7827
|
+
...user,
|
|
7828
|
+
totpEnabled
|
|
7829
|
+
};
|
|
7812
7830
|
},
|
|
7813
7831
|
listApiKeys: async () => {
|
|
7814
7832
|
if (!this.apiKeyManager) return [];
|