strapi-plugin-magic-sessionmanager 4.6.1 → 4.6.3

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 CHANGED
@@ -1,3 +1,17 @@
1
+ ## [4.6.3](https://github.com/Schero94/Magic-Sessionmanager/compare/v4.6.2...v4.6.3) (2026-06-23)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **session:** avoid touching sessions after logout ([a1791e5](https://github.com/Schero94/Magic-Sessionmanager/commit/a1791e5e953dc6075cd2d5a76ca1266f15f1dad2))
7
+
8
+ ## [4.6.2](https://github.com/Schero94/Magic-Sessionmanager/compare/v4.6.1...v4.6.2) (2026-06-23)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **security:** avoid logging license keys ([448717c](https://github.com/Schero94/Magic-Sessionmanager/commit/448717cdc1a549238b3696a765f3051112ef1049))
14
+
1
15
  ## [4.6.1](https://github.com/Schero94/Magic-Sessionmanager/compare/v4.6.0...v4.6.1) (2026-06-21)
2
16
 
3
17
 
@@ -749,10 +749,17 @@ var require_last_seen = __commonJS({
749
749
  "/api/register",
750
750
  "/admin/"
751
751
  ];
752
+ var SELF_TERMINATING_PATHS = /* @__PURE__ */ new Set([
753
+ "/api/magic-sessionmanager/logout",
754
+ "/api/magic-sessionmanager/logout-all"
755
+ ]);
752
756
  function isAuthEndpoint(path) {
753
757
  if (!path) return false;
754
758
  return AUTH_PATH_PREFIXES.some((prefix) => path.startsWith(prefix));
755
759
  }
760
+ function isSelfTerminatingEndpoint(path) {
761
+ return SELF_TERMINATING_PATHS.has(path);
762
+ }
756
763
  module2.exports = ({ strapi: strapi2, sessionService }) => {
757
764
  return async (ctx, next) => {
758
765
  if (isAuthEndpoint(ctx.path)) {
@@ -796,6 +803,9 @@ var require_last_seen = __commonJS({
796
803
  ctx.state.userDocumentId = userDocId;
797
804
  ctx.state.__magicSessionId = thisSession.documentId;
798
805
  await next();
806
+ if (isSelfTerminatingEndpoint(ctx.path)) {
807
+ return;
808
+ }
799
809
  try {
800
810
  await sessionService.touch({
801
811
  userId: userDocId,
@@ -13250,7 +13260,7 @@ var require_session2 = __commonJS({
13250
13260
  var require_package = __commonJS({
13251
13261
  "package.json"(exports2, module2) {
13252
13262
  module2.exports = {
13253
- version: "4.6.1",
13263
+ version: "4.6.3",
13254
13264
  keywords: [
13255
13265
  "strapi",
13256
13266
  "plugin",
@@ -13483,7 +13493,7 @@ var require_license_guard = __commonJS({
13483
13493
  });
13484
13494
  const data = await response.json();
13485
13495
  if (data.success) {
13486
- log.info("[SUCCESS] License created:", data.data.licenseKey);
13496
+ log.info("[SUCCESS] License created");
13487
13497
  return data.data;
13488
13498
  }
13489
13499
  log.warn("[WARNING] License creation rejected by server:", data.message || "unknown");
@@ -755,10 +755,17 @@ var require_last_seen = __commonJS({
755
755
  "/api/register",
756
756
  "/admin/"
757
757
  ];
758
+ var SELF_TERMINATING_PATHS = /* @__PURE__ */ new Set([
759
+ "/api/magic-sessionmanager/logout",
760
+ "/api/magic-sessionmanager/logout-all"
761
+ ]);
758
762
  function isAuthEndpoint(path) {
759
763
  if (!path) return false;
760
764
  return AUTH_PATH_PREFIXES.some((prefix) => path.startsWith(prefix));
761
765
  }
766
+ function isSelfTerminatingEndpoint(path) {
767
+ return SELF_TERMINATING_PATHS.has(path);
768
+ }
762
769
  module.exports = ({ strapi: strapi2, sessionService }) => {
763
770
  return async (ctx, next) => {
764
771
  if (isAuthEndpoint(ctx.path)) {
@@ -802,6 +809,9 @@ var require_last_seen = __commonJS({
802
809
  ctx.state.userDocumentId = userDocId;
803
810
  ctx.state.__magicSessionId = thisSession.documentId;
804
811
  await next();
812
+ if (isSelfTerminatingEndpoint(ctx.path)) {
813
+ return;
814
+ }
805
815
  try {
806
816
  await sessionService.touch({
807
817
  userId: userDocId,
@@ -13256,7 +13266,7 @@ var require_session2 = __commonJS({
13256
13266
  var require_package = __commonJS({
13257
13267
  "package.json"(exports, module) {
13258
13268
  module.exports = {
13259
- version: "4.6.1",
13269
+ version: "4.6.3",
13260
13270
  keywords: [
13261
13271
  "strapi",
13262
13272
  "plugin",
@@ -13489,7 +13499,7 @@ var require_license_guard = __commonJS({
13489
13499
  });
13490
13500
  const data = await response.json();
13491
13501
  if (data.success) {
13492
- log.info("[SUCCESS] License created:", data.data.licenseKey);
13502
+ log.info("[SUCCESS] License created");
13493
13503
  return data.data;
13494
13504
  }
13495
13505
  log.warn("[WARNING] License creation rejected by server:", data.message || "unknown");
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "4.6.1",
2
+ "version": "4.6.3",
3
3
  "keywords": [
4
4
  "strapi",
5
5
  "plugin",