@7365admin1/core 3.53.6 → 3.53.7
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 +6 -0
- package/dist/index.js +18 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +18 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/test/verification-scope.test.mjs +96 -0
package/dist/index.mjs
CHANGED
|
@@ -15053,6 +15053,19 @@ async function requireUserFieldWrite(req, userId, field, grant) {
|
|
|
15053
15053
|
return await requirePlatformStaff(req, grant);
|
|
15054
15054
|
return await requireSelfOrPlatformStaff(req, userId, grant);
|
|
15055
15055
|
}
|
|
15056
|
+
async function requireVerificationListReach(req, orgId) {
|
|
15057
|
+
if (orgId) {
|
|
15058
|
+
await requireOrgReach(req, orgId);
|
|
15059
|
+
return;
|
|
15060
|
+
}
|
|
15061
|
+
await requirePlatformStaff(req);
|
|
15062
|
+
}
|
|
15063
|
+
async function requireVerificationReach(req, verification) {
|
|
15064
|
+
const org = verification?.metadata?.org?.toString?.() ?? "";
|
|
15065
|
+
if (!org)
|
|
15066
|
+
return;
|
|
15067
|
+
await requireOrgReach(req, org);
|
|
15068
|
+
}
|
|
15056
15069
|
|
|
15057
15070
|
// src/services/service-provider-invite.service.ts
|
|
15058
15071
|
var INVITE_VALID_HOURS = 72;
|
|
@@ -27103,6 +27116,7 @@ function useVerificationController() {
|
|
|
27103
27116
|
});
|
|
27104
27117
|
}
|
|
27105
27118
|
try {
|
|
27119
|
+
await requireVerificationListReach(req, orgId);
|
|
27106
27120
|
const data = await _getVerifications({
|
|
27107
27121
|
search,
|
|
27108
27122
|
page,
|
|
@@ -27190,6 +27204,7 @@ function useVerificationController() {
|
|
|
27190
27204
|
return;
|
|
27191
27205
|
}
|
|
27192
27206
|
try {
|
|
27207
|
+
await requireVerificationReach(req, await _getVerificationById(otpId));
|
|
27193
27208
|
await _cancelUserInvitation(otpId);
|
|
27194
27209
|
res.json({
|
|
27195
27210
|
message: "User invite has been cancelled."
|
|
@@ -85124,7 +85139,7 @@ function useVerificationControllerV2() {
|
|
|
85124
85139
|
cancelUserInvitation: _cancelUserInvitation,
|
|
85125
85140
|
resendSignUpVerification: _resendSignUpVerification
|
|
85126
85141
|
} = useVerificationServiceV2();
|
|
85127
|
-
const { getVerifications: _getVerifications } = useVerificationRepoV2();
|
|
85142
|
+
const { getVerifications: _getVerifications, getVerificationById: _getVerificationById } = useVerificationRepoV2();
|
|
85128
85143
|
async function verify(req, res, next) {
|
|
85129
85144
|
try {
|
|
85130
85145
|
const schema2 = Joi142.object({ verificationCode: Joi142.string().required() });
|
|
@@ -85305,6 +85320,7 @@ function useVerificationControllerV2() {
|
|
|
85305
85320
|
}
|
|
85306
85321
|
const { search, page, status, app, email, type } = value;
|
|
85307
85322
|
try {
|
|
85323
|
+
await requireVerificationListReach(req, null);
|
|
85308
85324
|
const data = await _getVerifications({
|
|
85309
85325
|
search,
|
|
85310
85326
|
page,
|
|
@@ -85331,6 +85347,7 @@ function useVerificationControllerV2() {
|
|
|
85331
85347
|
return;
|
|
85332
85348
|
}
|
|
85333
85349
|
try {
|
|
85350
|
+
await requireVerificationReach(req, await _getVerificationById(otpId));
|
|
85334
85351
|
await _cancelUserInvitation(otpId);
|
|
85335
85352
|
res.json({
|
|
85336
85353
|
message: "User invite has been cancelled."
|