strapi-plugin-magic-sessionmanager 4.6.2 → 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 +7 -0
- package/dist/server/index.js +11 -1
- package/dist/server/index.mjs +11 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
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
|
+
|
|
1
8
|
## [4.6.2](https://github.com/Schero94/Magic-Sessionmanager/compare/v4.6.1...v4.6.2) (2026-06-23)
|
|
2
9
|
|
|
3
10
|
|
package/dist/server/index.js
CHANGED
|
@@ -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.
|
|
13263
|
+
version: "4.6.3",
|
|
13254
13264
|
keywords: [
|
|
13255
13265
|
"strapi",
|
|
13256
13266
|
"plugin",
|
package/dist/server/index.mjs
CHANGED
|
@@ -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.
|
|
13269
|
+
version: "4.6.3",
|
|
13260
13270
|
keywords: [
|
|
13261
13271
|
"strapi",
|
|
13262
13272
|
"plugin",
|
package/package.json
CHANGED