@7365admin1/core 3.52.17 → 3.52.18
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/CHANGELOG.md +22 -0
- package/dist/index.js +7 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/test/e2e/harness.mjs +5 -2
- package/test/e2e/subscription-read-scope.e2e.test.mjs +182 -0
- package/test/e2e/user-email-lookup-leak.e2e.test.mjs +68 -1
package/dist/index.mjs
CHANGED
|
@@ -18091,11 +18091,11 @@ async function requireUserFieldWrite(req, userId, field) {
|
|
|
18091
18091
|
}
|
|
18092
18092
|
|
|
18093
18093
|
// src/utils/user-response.util.ts
|
|
18094
|
-
function
|
|
18094
|
+
function publicIdentity(user) {
|
|
18095
18095
|
if (!user || typeof user !== "object")
|
|
18096
18096
|
return user;
|
|
18097
|
-
const {
|
|
18098
|
-
return
|
|
18097
|
+
const { _id, name, email } = user;
|
|
18098
|
+
return { _id, name, email };
|
|
18099
18099
|
}
|
|
18100
18100
|
|
|
18101
18101
|
// src/controllers/user.controller.ts
|
|
@@ -18187,7 +18187,7 @@ function useUserController() {
|
|
|
18187
18187
|
return;
|
|
18188
18188
|
}
|
|
18189
18189
|
const user = await _getByEmail(email);
|
|
18190
|
-
res.json(
|
|
18190
|
+
res.json(publicIdentity(user));
|
|
18191
18191
|
return;
|
|
18192
18192
|
} catch (error2) {
|
|
18193
18193
|
logger24.log({ level: "error", message: `${error2.message}` });
|
|
@@ -31232,6 +31232,7 @@ function useSubscriptionController() {
|
|
|
31232
31232
|
return;
|
|
31233
31233
|
}
|
|
31234
31234
|
try {
|
|
31235
|
+
await requireOrgAccess(req, _id);
|
|
31235
31236
|
const data = await _getByOrgId(_id);
|
|
31236
31237
|
res.json(data);
|
|
31237
31238
|
return;
|
|
@@ -31258,6 +31259,7 @@ function useSubscriptionController() {
|
|
|
31258
31259
|
const page = parseInt(req.query.page ?? "1");
|
|
31259
31260
|
const status = req.query.status ?? "active";
|
|
31260
31261
|
try {
|
|
31262
|
+
await requirePlatformStaff(req);
|
|
31261
31263
|
const data = await _getSubscriptions({ search, page, status });
|
|
31262
31264
|
res.json(data);
|
|
31263
31265
|
return;
|
|
@@ -86217,7 +86219,7 @@ function useUserControllerV2() {
|
|
|
86217
86219
|
return rejectValidation(error, next);
|
|
86218
86220
|
try {
|
|
86219
86221
|
const user = await _getUserByEmail(value);
|
|
86220
|
-
res.json(
|
|
86222
|
+
res.json(publicIdentity(user));
|
|
86221
86223
|
return;
|
|
86222
86224
|
} catch (err) {
|
|
86223
86225
|
logger202.log({ level: "error", message: `${err.message}` });
|