@strapi-community/plugin-io 5.3.5 → 5.3.6
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/server/index.js +13 -1
- package/dist/server/index.mjs +13 -1
- package/package.json +1 -1
package/dist/server/index.js
CHANGED
|
@@ -557,6 +557,10 @@ async function bootstrapIO$1({ strapi: strapi2 }) {
|
|
|
557
557
|
if (callback) callback({ success: false, error: "Presence is disabled" });
|
|
558
558
|
return;
|
|
559
559
|
}
|
|
560
|
+
if (!socket.user) {
|
|
561
|
+
if (callback) callback({ success: false, error: "Authentication required for presence" });
|
|
562
|
+
return;
|
|
563
|
+
}
|
|
560
564
|
if (!uid || !documentId) {
|
|
561
565
|
if (callback) callback({ success: false, error: "uid and documentId are required" });
|
|
562
566
|
return;
|
|
@@ -569,6 +573,10 @@ async function bootstrapIO$1({ strapi: strapi2 }) {
|
|
|
569
573
|
if (callback) callback({ success: false, error: "Presence is disabled" });
|
|
570
574
|
return;
|
|
571
575
|
}
|
|
576
|
+
if (!socket.user) {
|
|
577
|
+
if (callback) callback({ success: false, error: "Authentication required for presence" });
|
|
578
|
+
return;
|
|
579
|
+
}
|
|
572
580
|
if (!uid || !documentId) {
|
|
573
581
|
if (callback) callback({ success: false, error: "uid and documentId are required" });
|
|
574
582
|
return;
|
|
@@ -577,6 +585,10 @@ async function bootstrapIO$1({ strapi: strapi2 }) {
|
|
|
577
585
|
if (callback) callback(result);
|
|
578
586
|
}));
|
|
579
587
|
socket.on("presence:heartbeat", (callback) => {
|
|
588
|
+
if (!socket.user) {
|
|
589
|
+
if (callback) callback({ success: false, error: "Authentication required for presence" });
|
|
590
|
+
return;
|
|
591
|
+
}
|
|
580
592
|
const result = presenceService.heartbeat(socket.id);
|
|
581
593
|
if (callback) callback(result);
|
|
582
594
|
});
|
|
@@ -29744,7 +29756,7 @@ const dist = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty
|
|
|
29744
29756
|
const require$$0 = /* @__PURE__ */ getAugmentedNamespace(dist);
|
|
29745
29757
|
const { pluginId: pluginId$5 } = pluginId_1;
|
|
29746
29758
|
const { errors } = require$$0;
|
|
29747
|
-
const
|
|
29759
|
+
const z = require$$2__default$2.default;
|
|
29748
29760
|
const settingsSchema = z.object({
|
|
29749
29761
|
enabled: z.boolean().optional(),
|
|
29750
29762
|
cors: z.object({
|
package/dist/server/index.mjs
CHANGED
|
@@ -525,6 +525,10 @@ async function bootstrapIO$1({ strapi: strapi2 }) {
|
|
|
525
525
|
if (callback) callback({ success: false, error: "Presence is disabled" });
|
|
526
526
|
return;
|
|
527
527
|
}
|
|
528
|
+
if (!socket.user) {
|
|
529
|
+
if (callback) callback({ success: false, error: "Authentication required for presence" });
|
|
530
|
+
return;
|
|
531
|
+
}
|
|
528
532
|
if (!uid || !documentId) {
|
|
529
533
|
if (callback) callback({ success: false, error: "uid and documentId are required" });
|
|
530
534
|
return;
|
|
@@ -537,6 +541,10 @@ async function bootstrapIO$1({ strapi: strapi2 }) {
|
|
|
537
541
|
if (callback) callback({ success: false, error: "Presence is disabled" });
|
|
538
542
|
return;
|
|
539
543
|
}
|
|
544
|
+
if (!socket.user) {
|
|
545
|
+
if (callback) callback({ success: false, error: "Authentication required for presence" });
|
|
546
|
+
return;
|
|
547
|
+
}
|
|
540
548
|
if (!uid || !documentId) {
|
|
541
549
|
if (callback) callback({ success: false, error: "uid and documentId are required" });
|
|
542
550
|
return;
|
|
@@ -545,6 +553,10 @@ async function bootstrapIO$1({ strapi: strapi2 }) {
|
|
|
545
553
|
if (callback) callback(result);
|
|
546
554
|
}));
|
|
547
555
|
socket.on("presence:heartbeat", (callback) => {
|
|
556
|
+
if (!socket.user) {
|
|
557
|
+
if (callback) callback({ success: false, error: "Authentication required for presence" });
|
|
558
|
+
return;
|
|
559
|
+
}
|
|
548
560
|
const result = presenceService.heartbeat(socket.id);
|
|
549
561
|
if (callback) callback(result);
|
|
550
562
|
});
|
|
@@ -29712,7 +29724,7 @@ const dist = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty
|
|
|
29712
29724
|
const require$$0 = /* @__PURE__ */ getAugmentedNamespace(dist);
|
|
29713
29725
|
const { pluginId: pluginId$5 } = pluginId_1;
|
|
29714
29726
|
const { errors } = require$$0;
|
|
29715
|
-
const
|
|
29727
|
+
const z = require$$2$2;
|
|
29716
29728
|
const settingsSchema = z.object({
|
|
29717
29729
|
enabled: z.boolean().optional(),
|
|
29718
29730
|
cors: z.object({
|
package/package.json
CHANGED