strapi-plugin-magic-sessionmanager 4.14.2 → 4.15.0

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.
Files changed (30) hide show
  1. package/CHANGELOG.md +64 -0
  2. package/README.md +151 -79
  3. package/dist/admin/{Analytics-Box2STtg.js → Analytics-Dbs5QXLb.js} +1 -1
  4. package/dist/admin/{Analytics-DfDdcjMe.mjs → Analytics-HK6_TEmk.mjs} +1 -1
  5. package/dist/admin/{App-DzxXcTYs.js → App-7SxOBJP5.js} +63 -29
  6. package/dist/admin/{App-B2JIOiNM.mjs → App-BOFzZ5d8.mjs} +64 -30
  7. package/dist/admin/{OnlineUsersWidget-BOd7p_MF.mjs → OnlineUsersWidget-CoCxnww-.mjs} +1 -1
  8. package/dist/admin/{OnlineUsersWidget-D4M4D6rm.js → OnlineUsersWidget-Dns_74xJ.js} +1 -1
  9. package/dist/admin/{Settings-DNgH9qRy.js → Settings-B6CrR-07.js} +257 -64
  10. package/dist/admin/{Settings-BFdr77zD.mjs → Settings-DYRShQ8W.mjs} +258 -65
  11. package/dist/admin/{de-BlKn1pSD.mjs → de-B3mPtxsW.mjs} +39 -7
  12. package/dist/admin/{de-B0CBR1Dw.js → de-bkkCvSxX.js} +39 -7
  13. package/dist/admin/{en-IT0YTY8f.mjs → en-BnU8BNkN.mjs} +39 -7
  14. package/dist/admin/{en-D0ZGIIjz.js → en-DMICyIow.js} +39 -7
  15. package/dist/admin/{es-BCGzaaCh.mjs → es-BxMgfJ1Y.mjs} +39 -7
  16. package/dist/admin/{es-CWee-XCR.js → es-OSzHGRIu.js} +39 -7
  17. package/dist/admin/{fr-rQS1M7jE.js → fr-Bu_8miJ4.js} +39 -7
  18. package/dist/admin/{fr-xBIH4Byq.mjs → fr-WPrbtx8k.mjs} +39 -7
  19. package/dist/admin/{index-CmW1DJ0c.js → index-CNSJITRX.js} +9 -9
  20. package/dist/admin/{index-C2SrNW6I.mjs → index-lnZBc5n0.mjs} +9 -9
  21. package/dist/admin/index.js +1 -1
  22. package/dist/admin/index.mjs +1 -1
  23. package/dist/admin/{pt-C-yTLhnS.js → pt-B08xnb0K.js} +39 -7
  24. package/dist/admin/{pt-DWDeIDVa.mjs → pt-C41KyEDN.mjs} +39 -7
  25. package/dist/admin/riskData-BVs9GpgD.js +26 -0
  26. package/dist/admin/riskData-CI1gm2yI.mjs +27 -0
  27. package/dist/server/index.js +565 -178
  28. package/dist/server/index.mjs +565 -178
  29. package/package.json +3 -3
  30. package/scripts/geoip-updater.cjs +58 -15
package/CHANGELOG.md CHANGED
@@ -1,3 +1,67 @@
1
+ # [4.15.0](https://github.com/Schero94/Magic-Sessionmanager/compare/v4.14.3...v4.15.0) (2026-11-24)
2
+
3
+
4
+ ### Features
5
+
6
+ * honest risk data and VPN, proxy, Tor and hosting detection with local MaxMind databases ([#33](https://github.com/Schero94/Magic-Sessionmanager/issues/33)) ([80e1e7e](https://github.com/Schero94/Magic-Sessionmanager/commit/80e1e7e988f048b4716dfd0dc8487cef4cec37cd))
7
+
8
+
9
+ Release type: minor (`feat` for the new risk data source, `fix` for the honest UI). No breaking change for the HTTP API or stored settings; see the upgrade note for `securityScore: null`.
10
+
11
+ ### Added
12
+
13
+ * **Real risk data from a local MaxMind database.** Configuration › Location data › **Risk data (VPN, proxy, Tor)** downloads, with the existing MaxMind credentials, either the **GeoIP2 Anonymous IP** database (paid: VPN, public and residential proxies, Tor exit nodes, hosting providers) or the free **GeoLite2 ASN** database, used as a clearly labelled **heuristic** for large hosting and cloud networks only. Lookups are local through the installed `@maxmind/geoip2-node` (`anonymousIP()`, `asn()`); no IP address leaves the server and the license key never reaches the browser.
14
+ * With a risk source, "Reject suspicious sign-ins" refuses Tor exit nodes (`tor_exit_node`), VPNs and proxies, and scores below 50; hosting networks raise the suspicious-sign-in email and `login.suspicious` but are never refused. The VPN or proxy email fires for VPNs and proxies. Risk data is evaluated even when the location lookup itself failed.
15
+ * Lookup results add `isTor`, `isHosting`, `isAnonymous`, `isPublicProxy`, `isResidentialProxy` and `riskSource`; the existing names (`isVpn`, `isProxy`, `isThreat`, `securityScore`, `riskLevel`) keep their meaning. With the ASN database, `asn` and `org` are filled when the location provider gave none.
16
+ * `GET /magic-sessionmanager/geoip/status` reports `risk` (`available`, `source`, and per database `editionId`, `exists`, `usable`, `fromEnvironment`, `metadata`). `POST /magic-sessionmanager/geoip/update` accepts `database: 'location' | 'anonymous-ip' | 'asn'` (default `location`, anything else 400). A 401 or 403 from MaxMind answers 502 with "MaxMind refused the download. Check the credentials and that your account includes this database."
17
+ * The CLI updater accepts `MAXMIND_EDITION_ID=GeoIP2-Anonymous-IP` and `GeoLite2-ASN`; risk databases always go to their own file in `data/magic-sessionmanager/geoip/` and cannot be selected as the location database. New environment variables `MAGIC_SESSIONMANAGER_ANONYMOUS_IP_DATABASE` and `MAGIC_SESSIONMANAGER_ASN_DATABASE` point at existing files instead.
18
+ * Session details show "Hosting network" for live lookups, "Not available" for VPN and proxy when only the ASN heuristic answered, and a note on heuristic scores.
19
+ * MaxMind database readers watch their file without keeping the Node.js process alive.
20
+
21
+ ### Fixed
22
+
23
+ * **Suspicious sign-in detection was never active, and the admin and README said it was.** The plugin read VPN, proxy and threat flags from a `threat` object that ipapi.co does not send ([ipapi.co API](https://ipapi.co/api/) documents no such field), and it scored every local GeoLite2 result 100. So every flag was `false` and every score 100: "Reject suspicious sign-ins", the suspicious-sign-in email, the VPN or proxy email and the `login.suspicious` team notification could never fire. The dead parsing is removed. ipapi.co and GeoLite2 still provide location data; they no longer pretend to provide risk data.
24
+ * Without a risk data source, lookups report no risk data: the flags stay `false` (same field names), `securityScore` is `null` instead of a fake 100 (or 50 for failed and disabled lookups), `riskLevel` is `'Unknown'` and the new field `riskSource` is `null`. New sessions store `securityScore: null`; a session's `geoLocation` stores `riskSource` when risk data existed.
25
+ * Risk rules and alerts run only on results with a `riskSource`. Flags without one never refuse a sign-in, never send the suspicious-sign-in or VPN or proxy email, and never turn a team notification into `login.suspicious`.
26
+ * **Admin, Configuration:** while no risk data source is set up, "Reject suspicious sign-ins", "Security scoring" and the email types "Suspicious sign-in" and "VPN or proxy" are shown off and disabled with "Needs a risk data source" and a link to Location data. Login protection shows a "No risk data source" notice; Alerts says that `login.suspicious` is never sent. The hints no longer claim ipapi.co detects VPNs or that local results score 100.
27
+ * **Admin, Session details:** without risk data, one "Not available" row with "Set up risk data" replaces the security score, VPN and proxy rows. Sessions recorded before this release show "Not available", because their stored 100 was never a real check.
28
+ * Discord and Slack messages list risk findings only when the sign-in had risk data, and now also name Tor and hosting networks. The `{{reason.securityScore}}` email variable renders `N/A` instead of `0` when there is no score.
29
+ * README: the features table, Session details, the settings table, Location data, Login protection and Alerts describe what needs a risk data source; a new "Risk data (VPN, proxy, Tor)" section explains the previous behaviour.
30
+
31
+ * **A custom "Database file name" was never found.** The reader resolved `geoIpDatabasePath` (for example `GeoLite2-Country.mmdb`) against the Strapi folder, while the admin and CLI downloads write it to `data/magic-sessionmanager/geoip/`. A file name is now read from that folder first; a file in the Strapi folder is still found for older setups, and absolute paths are unchanged. The settings API keeps refusing `..` and folder names with a field error on `geoIpDatabasePath`.
32
+
33
+ ### Upgrade note
34
+
35
+ * Saved settings are kept as they are. A risk switch that was on stays stored, has no effect while no risk data source exists, and applies again once one is set up. The admin says "Saved as on. It takes effect once a risk data source is set up."
36
+ * Nothing changes until you add a risk database. **Check your switches before you download one:** a "Reject suspicious sign-ins" saved as on starts refusing VPN, proxy and Tor sign-ins as soon as the database is present, and the suspicious-sign-in and VPN or proxy emails (on by default once "Send security emails" is on) start to be sent.
37
+ * One rule keeps its previous behaviour: with `geoLookupFailureMode: 'auto'` and "Reject suspicious sign-ins" saved as on, a sign-in whose location cannot be determined is still rejected. Choose **Allow sign-in** under Login protection › Advanced › "If the location cannot be determined" to change that.
38
+ * Code that reads `securityScore` must accept `null`. Code that relied on `securityScore: 100` for local results, or on `isVpn`/`isProxy` from ipapi.co, never received real data; check `riskSource` instead.
39
+ * Stored sessions are not rewritten. Their old scores of 100 stay in the database; the admin ignores them because they carry no `riskSource`.
40
+
41
+ ### Tests
42
+
43
+ * `tests/geolocation-database-path.test.js` (regression, fails before the fix): a custom file name is read from the GeoIP folder, the Strapi-folder fallback and absolute paths still work, a missing file is reported for the GeoIP folder, and `..` or folder names are refused with a `geoIpDatabasePath` field error.
44
+ * `tests/risk-databases.test.js` reads synthetic MMDB fixtures (written by `tests/helpers/mmdb-writer.js`; no MaxMind data is shipped) with the real `@maxmind/geoip2-node` reader: VPN, Tor, hosting, public and residential proxy and a clean address; the ASN heuristic; both databases; a wrong database type; the status report; and full sign-ins where the reject rule, the VPN and suspicious emails (through the real notification service) and the `login.suspicious` Discord post actually fire. Also the download routing, the fixed refusal message and that a location setting cannot select a risk file.
45
+ * `tests/risk-honesty.test.js`: ipapi.co answers (even with a made-up `threat` object), failed and private lookups carry no score; without a source nothing is suspicious, no risk email or `login.suspicious` webhook is sent, and the new-country alert still works.
46
+ * `tests/admin/risk-honesty.test.jsx` renders the Configuration page and the session details: without a source the risk controls are off, disabled and explained, saved values are kept and nothing is saved; with a source they are live.
47
+ * `tests/geo-firewall.test.js`: flags without a source refuse nothing; the saved reject switch keeps the Automatic fail-closed rule.
48
+
49
+ ## [4.14.3](https://github.com/Schero94/Magic-Sessionmanager/compare/v4.14.2...v4.14.3) (2026-11-24)
50
+
51
+
52
+ ### Bug Fixes
53
+
54
+ * **admin:** space row actions like Strapi's own tables ([#32](https://github.com/Schero94/Magic-Sessionmanager/issues/32)) ([1c5cadc](https://github.com/Schero94/Magic-Sessionmanager/commit/1c5cadcc3d1f71c689b0ebc5741442744c33efe0))
55
+
56
+
57
+ ### Fixed
58
+
59
+ * **Row actions are spaced like Strapi's own tables.** In the Admin panel table the "View sessions" (eye) and red "Sign out everywhere" buttons, and in the App users table the "View details", "End session" and "More actions" buttons, were joined into one segmented `IconButtonGroup` and looked stuck together. They are separate actions, so they now sit 4 px apart in a right-aligned `Flex` (`gap={1}`), the layout Strapi uses in Settings > Webhooks and Settings > Users. Every other action group of the plugin already used a gap and is unchanged.
60
+
61
+ ### Tests
62
+
63
+ * `npm run test:admin`: the row actions of both tables render as a flex row with a 4 px gap (fails with the old `IconButtonGroup`).
64
+
1
65
  ## [4.14.2](https://github.com/Schero94/Magic-Sessionmanager/compare/v4.14.1...v4.14.2) (2026-11-18)
2
66
 
3
67
 
package/README.md CHANGED
@@ -51,25 +51,26 @@ Live docs: [https://schero94.github.io/Magic-Sessionmanager/](https://schero94.g
51
51
  - [Contributing](#contributing)
52
52
  - [Maintenance status](#maintenance-status)
53
53
  - [Languages](#languages)
54
+ - [Showcase your company](#showcase-your-company)
54
55
  - [License](#license)
55
56
 
56
57
  ---
57
58
 
58
59
  ## Features
59
60
 
60
- | Area | What you get |
61
- | ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
62
- | Overview | A sessions dashboard with Active, Idle and Ended counts, search, filters, CSV and JSON export, and a details dialog per session (device, browser, IP address, location, security score). |
63
- | Control | End one session, end all sessions of a user, delete a record, or block a user. Ended sessions are rejected on the next request with 401 and a reason header. |
64
- | Your users | Content API routes for "my sessions", "current session", log out, log out everywhere and log out other devices. Each user only ever sees their own sessions. |
65
- | Login protection | Temporary IP lockout after failed sign-ins, Content API rate limits, optional rejection of VPN, proxy or low-score sign-ins, and country allow or block lists. |
66
- | Location | IP location from a local MaxMind GeoLite2 database (no third party in the sign-in path) or from ipapi.co, or turned off. |
67
- | Alerts | Security emails to the user through Strapi's Email plugin and sign-in notifications to Discord or Slack. |
68
- | Admin integration | A Sessions panel next to each user in the Content Manager and an Online users widget on the Strapi homepage. |
69
- | Admin panel sessions | Who can use the Strapi admin panel, who is signed in, on which browser and since when. Sign an admin out of one browser or everywhere; it takes effect on their next click. |
70
- | Native Strapi sessions | Works with `jwtManagement: 'refresh'` (Strapi's own sessions and refresh tokens) and with `'legacy-support'`. |
71
- | Several processes | Lockout, rate limits, jobs and settings stay consistent across pm2 workers and Railway replicas that share one database. |
72
- | Privacy | Stored tokens are encrypted (AES-256-GCM) and never returned. Retention deletes old history automatically. No telemetry. |
61
+ | Area | What you get |
62
+ | ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
63
+ | Overview | A sessions dashboard with Active, Idle and Ended counts, search, filters, CSV and JSON export, and a details dialog per session (device, browser, IP address, location, and a security score when a [risk data source](#risk-data-vpn-proxy-tor) is set up). |
64
+ | Control | End one session, end all sessions of a user, delete a record, or block a user. Ended sessions are rejected on the next request with 401 and a reason header. |
65
+ | Your users | Content API routes for "my sessions", "current session", log out, log out everywhere and log out other devices. Each user only ever sees their own sessions. |
66
+ | Login protection | Temporary IP lockout after failed sign-ins, Content API rate limits, optional rejection of VPN, proxy or low-score sign-ins (needs a [risk data source](#risk-data-vpn-proxy-tor)), and country allow or block lists. |
67
+ | Location | IP location from a local MaxMind GeoLite2 database (no third party in the sign-in path) or from ipapi.co, or turned off. |
68
+ | Alerts | Security emails to the user through Strapi's Email plugin and sign-in notifications to Discord or Slack. |
69
+ | Admin integration | A Sessions panel next to each user in the Content Manager and an Online users widget on the Strapi homepage. |
70
+ | Admin panel sessions | Who can use the Strapi admin panel, who is signed in, on which browser and since when. Sign an admin out of one browser or everywhere; it takes effect on their next click. |
71
+ | Native Strapi sessions | Works with `jwtManagement: 'refresh'` (Strapi's own sessions and refresh tokens) and with `'legacy-support'`. |
72
+ | Several processes | Lockout, rate limits, jobs and settings stay consistent across pm2 workers and Railway replicas that share one database. |
73
+ | Privacy | Stored tokens are encrypted (AES-256-GCM) and never returned. Retention deletes old history automatically. No telemetry. |
73
74
 
74
75
  ---
75
76
 
@@ -207,7 +208,7 @@ Open **Session Manager** and switch to **Admin panel** (the switch below the tit
207
208
  ### Session details
208
209
 
209
210
  - A state sentence that explains why the session is in its state, for example "Ended {time} · Ended manually."
210
- - **User** (with an **Open user** link to the Content Manager), **Session** (Signed in, Last active, Ended at, End reason), **Device** (type, browser, operating system, IP address), **Location and security** (country, city, time zone, security score "{score}/100", VPN and proxy).
211
+ - **User** (with an **Open user** link to the Content Manager), **Session** (Signed in, Last active, Ended at, End reason), **Device** (type, browser, operating system, IP address), **Location and security** (country, city, time zone, and security score "{score}/100", VPN and proxy when the sign-in had [risk data](#risk-data-vpn-proxy-tor); otherwise one "Not available" row with a link to set up risk data. Sessions recorded before 4.15 show "Not available", because their stored score of 100 was never a real check).
211
212
  - **Look up location** for sessions without a stored location. The lookup runs only when you click it, because it can send the IP address to ipapi.co.
212
213
  - **Technical details** (collapsed): record ID with a copy button and the raw user agent.
213
214
  - Footer: **End session** with confirmation on open sessions; ended sessions show "This session has already ended."
@@ -236,7 +237,7 @@ Two links: **Configuration** and **Analytics**.
236
237
  | ---------------------- | --------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
237
238
  | **Sessions** | How long does a session stay valid? | Inactivity timeout, maximum session age; Advanced: "Last active" update interval, idle check interval and method. Token check (Strict / Relaxed); Advanced: grace period after sign-in, token encryption key generator. A read-only card on what your app receives when a session is rejected. |
238
239
  | **Login protection** | Which sign-ins are refused, and why? | Temporary IP lockout, Trust proxy headers, Reject suspicious sign-ins, If the location cannot be determined, Country rules (Allow only listed countries / Reject listed countries), a read-only card on why sign-ins are refused. |
239
- | **Location data** | Where do IP location and risk data come from? | IP location lookup, Security scoring, Provider, GeoIP database status, MaxMind credentials, Update database / Force download. |
240
+ | **Location data** | Where do IP location and risk data come from? | IP location lookup, Security scoring, Provider, GeoIP database status, MaxMind credentials, Update database / Force download, Risk data (GeoIP2 Anonymous IP, GeoLite2 ASN heuristic). |
240
241
  | **Alerts** | Who is told about sign-ins? | Security emails to users (with email templates) and Team notifications to Discord or Slack. |
241
242
  | **Data and retention** | How long is session history kept? | Keep ended sessions for, and **Delete ended sessions**. |
242
243
 
@@ -250,7 +251,7 @@ Two links: **Configuration** and **Analytics**.
250
251
 
251
252
  | Item | Supported |
252
253
  | -------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
253
- | Strapi | 5.50.0 and later 5.x (`@strapi/strapi` peer range `^5.50.0`). Tested in CI on 5.50.0 (floor) and 5.62.0 (acceptance host). Strapi 5.0 to 5.49 are not supported, see [Upgrading › Strapi older than 5.50](#strapi-older-than-550). |
254
+ | Strapi | 5.50.0 and later 5.x (`@strapi/strapi` peer range `^5.50.0`). Tested in CI on 5.50.0 (floor) and 5.63.0 (acceptance host). Strapi 5.0 to 5.49 are not supported, see [Upgrading › Strapi older than 5.50](#strapi-older-than-550). |
254
255
  | Node.js | `^22.22.2 \|\| >=24.15.0` (`engines.node`) |
255
256
  | Users & Permissions | `jwtManagement: 'refresh'` and `'legacy-support'` |
256
257
  | Homepage widget | Included (Strapi's widgets API exists since 5.13). |
@@ -368,41 +369,43 @@ export default () => ({
368
369
 
369
370
  Static defaults from `server/src/config/index.js`; admin units and ranges from the settings validation in `server/src/controllers/settings.js`. Out-of-range admin values are rejected with a field error, not clamped silently.
370
371
 
371
- | Key | Default | Admin unit and range | Configuration tab | Meaning |
372
- | ------------------------------------------------------------------- | --------------------------------------------- | ----------------------------------------------------------------- | ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
373
- | `inactivityTimeout` | 15 min (`900000` ms) | min, 1 to 1440 | Sessions | Unused this long, a session becomes idle and then ends as "Timed out". Also decides who counts as online. |
374
- | `maxSessionAgeDays` | 30 | days, 1 to 365 | Sessions | Maximum age from sign-in, regardless of activity. Applied on the session's next request. |
375
- | `lastSeenRateLimit` | 30 s (`30000` ms) | s, 5 to 300 | Sessions › Advanced | Minimum interval between "Last active" updates. |
376
- | `cleanupInterval` | 30 min (`1800000` ms) | min, 5 to 1440 | Sessions › Advanced | How often the idle check runs. It ends idle sessions and deletes nothing. It also runs at server start; with several instances only one runs it per interval. |
377
- | `cleanupUseDbDirect` | `false` | boolean | Sessions › Advanced | Idle check with one SQL update instead of the Document Service (skips lifecycle hooks). |
378
- | `strictSessionEnforcement` | `false` (Relaxed) | boolean | Sessions | Strict rejects tokens without a session record and requests where the check itself fails. Ended, expired and revoked sessions and blocked users are rejected in both modes. |
379
- | `sessionCreationGraceMs` | `5000` | ms, 0 to 30000 (shown in seconds) | Sessions › Advanced | Window after sign-in in which a token is accepted while its record is being created. |
380
- | `maxFailedLogins` | 5 | 0 to 100, 0 = off | Login protection | Temporary IP lockout threshold (failed sign-ins from one IP within 15 minutes). |
381
- | `trustedProxies` | off | boolean | Login protection | Read the client IP from proxy headers. Only behind a proxy you control. |
382
- | `blockSuspiciousSessions` | `false` | boolean | Login protection | Reject suspicious sign-ins. |
383
- | `geoLookupFailureMode` | `'auto'` | auto, allow, block | Login protection | What happens when the location cannot be determined. |
384
- | `enableGeofencing` | `false` | boolean | Login protection | Use country rules. |
385
- | `allowedCountries` / `blockedCountries` | `[]` | ISO 3166-1 alpha-2 codes | Login protection | Allow only listed countries / Reject listed countries. |
386
- | `enableGeolocation` | `true` | boolean | Location data | IP location lookup at sign-in. Required by country rules, suspicious-sign-in checks and alerts. |
387
- | `enableSecurityScoring` | `true` | boolean | Location data | Apply the security score thresholds (below 70: suspicious-sign-in email, below 50: rejection if enabled). |
388
- | `geoIpProvider` | `'auto'` | auto, local-mmdb, ipapi, disabled | Location data | Where location data comes from. |
389
- | `geoIpDatabasePath` | `MAGIC_SESSIONMANAGER_GEOIP_DATABASE` or `''` | file name | Location data › Advanced | Local MaxMind-compatible database. |
390
- | `enableEmailAlerts` | `false` | boolean | Alerts | Security emails to users. |
391
- | `alertOnSuspiciousLogin` / `alertOnNewLocation` / `alertOnVpnProxy` | `true` | boolean | Alerts | Which events send an email. |
392
- | `enableWebhooks` | `false` | boolean | Alerts | Team notifications. |
393
- | `discordWebhookUrl` / `slackWebhookUrl` | `''` | https URL on discord.com / discordapp.com, or hooks.slack.com | Alerts | Any other host is rejected. |
394
- | `retentionDays` | 90 | days, 1 to 365 or -1 (forever) | Data and retention | How long records of ended sessions are kept. Checked once a day across all instances, the first time about 5 minutes after the server starts. Open sessions are never deleted by retention. |
395
- | `rateLimitWriteMax` / `rateLimitReadMax` / `rateLimitWindowSeconds` | 10 / 120 / 60 | 1 to 1000 / 1 to 10000 / 10 to 3600 | not shown | Content API rate limits. Not editable in the UI; Save keeps the stored values. The write limit can only be made stricter than the route floor. |
396
- | `emailTemplates` | empty | subject ≤ 200, HTML ≤ 10,000 (sanitised), text ≤ 5,000 characters | Alerts › Edit email templates | As soon as any template has content, only stored templates are used. Fill in all three, or none. |
372
+ | Key | Default | Admin unit and range | Configuration tab | Meaning |
373
+ | ------------------------------------------------------------------- | --------------------------------------------- | ----------------------------------------------------------------- | ----------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
374
+ | `inactivityTimeout` | 15 min (`900000` ms) | min, 1 to 1440 | Sessions | Unused this long, a session becomes idle and then ends as "Timed out". Also decides who counts as online. |
375
+ | `maxSessionAgeDays` | 30 | days, 1 to 365 | Sessions | Maximum age from sign-in, regardless of activity. Applied on the session's next request. |
376
+ | `lastSeenRateLimit` | 30 s (`30000` ms) | s, 5 to 300 | Sessions › Advanced | Minimum interval between "Last active" updates. |
377
+ | `cleanupInterval` | 30 min (`1800000` ms) | min, 5 to 1440 | Sessions › Advanced | How often the idle check runs. It ends idle sessions and deletes nothing. It also runs at server start; with several instances only one runs it per interval. |
378
+ | `cleanupUseDbDirect` | `false` | boolean | Sessions › Advanced | Idle check with one SQL update instead of the Document Service (skips lifecycle hooks). |
379
+ | `strictSessionEnforcement` | `false` (Relaxed) | boolean | Sessions | Strict rejects tokens without a session record and requests where the check itself fails. Ended, expired and revoked sessions and blocked users are rejected in both modes. |
380
+ | `sessionCreationGraceMs` | `5000` | ms, 0 to 30000 (shown in seconds) | Sessions › Advanced | Window after sign-in in which a token is accepted while its record is being created. |
381
+ | `maxFailedLogins` | 5 | 0 to 100, 0 = off | Login protection | Temporary IP lockout threshold (failed sign-ins from one IP within 15 minutes). |
382
+ | `trustedProxies` | off | boolean | Login protection | Read the client IP from proxy headers. Only behind a proxy you control. |
383
+ | `blockSuspiciousSessions` | `false` | boolean | Login protection | Reject suspicious sign-ins. Needs a [risk data source](#risk-data-vpn-proxy-tor); without one it is shown off and disabled, and the saved value is kept. |
384
+ | `geoLookupFailureMode` | `'auto'` | auto, allow, block | Login protection | What happens when the location cannot be determined. |
385
+ | `enableGeofencing` | `false` | boolean | Login protection | Use country rules. |
386
+ | `allowedCountries` / `blockedCountries` | `[]` | ISO 3166-1 alpha-2 codes | Login protection | Allow only listed countries / Reject listed countries. |
387
+ | `enableGeolocation` | `true` | boolean | Location data | IP location lookup at sign-in. Required by country rules, suspicious-sign-in checks and alerts. |
388
+ | `enableSecurityScoring` | `true` | boolean | Location data | Apply the security score thresholds (below 70: suspicious-sign-in email, below 50: rejection if enabled). Needs a [risk data source](#risk-data-vpn-proxy-tor). |
389
+ | `geoIpProvider` | `'auto'` | auto, local-mmdb, ipapi, disabled | Location data | Where location data comes from. |
390
+ | `geoIpDatabasePath` | `MAGIC_SESSIONMANAGER_GEOIP_DATABASE` or `''` | file name | Location data › Advanced | Local MaxMind-compatible database. A file name is read from `data/magic-sessionmanager/geoip/` (where downloads write it), then from the Strapi folder for older setups; an absolute path is used as it is. Names with `..` or folders are refused with a field error. A file name is read from `data/magic-sessionmanager/geoip/` (where downloads write it), then from the Strapi folder for older setups; an absolute path is used as it is. Names with `..` or folders are refused with a field error. |
391
+ | `enableEmailAlerts` | `false` | boolean | Alerts | Security emails to users. |
392
+ | `alertOnSuspiciousLogin` / `alertOnNewLocation` / `alertOnVpnProxy` | `true` | boolean | Alerts | Which events send an email. Suspicious sign-in and VPN or proxy need a [risk data source](#risk-data-vpn-proxy-tor). |
393
+ | `enableWebhooks` | `false` | boolean | Alerts | Team notifications. |
394
+ | `discordWebhookUrl` / `slackWebhookUrl` | `''` | https URL on discord.com / discordapp.com, or hooks.slack.com | Alerts | Any other host is rejected. |
395
+ | `retentionDays` | 90 | days, 1 to 365 or -1 (forever) | Data and retention | How long records of ended sessions are kept. Checked once a day across all instances, the first time about 5 minutes after the server starts. Open sessions are never deleted by retention. |
396
+ | `rateLimitWriteMax` / `rateLimitReadMax` / `rateLimitWindowSeconds` | 10 / 120 / 60 | 1 to 1000 / 1 to 10000 / 10 to 3600 | not shown | Content API rate limits. Not editable in the UI; Save keeps the stored values. The write limit can only be made stricter than the route floor. |
397
+ | `emailTemplates` | empty | subject ≤ 200, HTML ≤ 10,000 (sanitised), text ≤ 5,000 characters | Alerts › Edit email templates | As soon as any template has content, only stored templates are used. Fill in all three, or none. |
397
398
 
398
399
  ### Environment variables
399
400
 
400
- | Variable | Purpose |
401
- | ------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
402
- | `SESSION_ENCRYPTION_KEY` | Key for AES-256-GCM encryption of stored tokens. Required when `NODE_ENV=production` (startup fails without it). Keep it stable. |
403
- | `MAGIC_SESSIONMANAGER_GEOIP_DATABASE` | Path of a local MaxMind-compatible database (also `GEOIP_DATABASE_PATH`, `GEOLITE2_CITY_MMDB`, `GEOIP_CITY_DATABASE_PATH`, `GEOLITE2_COUNTRY_MMDB`, `GEOIP_COUNTRY_DATABASE_PATH`). |
404
- | `MAXMIND_ACCOUNT_ID`, `MAXMIND_LICENSE_KEY` | MaxMind credentials for database updates. They take precedence over credentials stored in the admin. |
405
- | `MAXMIND_EDITION_ID` | Edition for the CLI updater, for example `GeoLite2-City`. |
401
+ | Variable | Purpose |
402
+ | -------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
403
+ | `SESSION_ENCRYPTION_KEY` | Key for AES-256-GCM encryption of stored tokens. Required when `NODE_ENV=production` (startup fails without it). Keep it stable. |
404
+ | `MAGIC_SESSIONMANAGER_GEOIP_DATABASE` | Path of a local MaxMind-compatible database (also `GEOIP_DATABASE_PATH`, `GEOLITE2_CITY_MMDB`, `GEOIP_CITY_DATABASE_PATH`, `GEOLITE2_COUNTRY_MMDB`, `GEOIP_COUNTRY_DATABASE_PATH`). |
405
+ | `MAXMIND_ACCOUNT_ID`, `MAXMIND_LICENSE_KEY` | MaxMind credentials for database updates. They take precedence over credentials stored in the admin. |
406
+ | `MAGIC_SESSIONMANAGER_ANONYMOUS_IP_DATABASE` | Path of a GeoIP2 Anonymous IP database (risk data). Default: `data/magic-sessionmanager/geoip/GeoIP2-Anonymous-IP.mmdb`. |
407
+ | `MAGIC_SESSIONMANAGER_ASN_DATABASE` | Path of a GeoLite2 ASN database (hosting heuristic). Default: `data/magic-sessionmanager/geoip/GeoLite2-ASN.mmdb`. |
408
+ | `MAXMIND_EDITION_ID` | Edition for the CLI updater, for example `GeoLite2-City`. |
406
409
 
407
410
  ---
408
411
 
@@ -425,7 +428,7 @@ The MaxMind database download is a separate authenticated network request; the M
425
428
 
426
429
  ### Local MaxMind database (recommended)
427
430
 
428
- A local GeoLite2 City database avoids remote lookups in the sign-in path and gives country, city, region, time zone and coordinates. GeoLite2 Country databases are supported as a country-only fallback. Free GeoLite databases do not detect VPNs or proxies, and local results always score 100.
431
+ A local GeoLite2 City database avoids remote lookups in the sign-in path and gives country, city, region, time zone and coordinates. GeoLite2 Country databases are supported as a country-only fallback. Location databases (GeoLite2 and GeoIP2 City or Country) carry no VPN, proxy or Tor data, so they give no security score; see [Risk data](#risk-data-vpn-proxy-tor).
429
432
 
430
433
  1. Create a free MaxMind account: https://dev.maxmind.com/geoip/geolite2-free-geolocation-data/
431
434
  2. In **Configuration › Location data**, choose the provider **Local database**, enter the MaxMind account ID and license key, and click **Update database**. The license key is stored in the plugin store and never returned to the browser.
@@ -442,6 +445,51 @@ npm run geoip:update # in the plugin repository
442
445
 
443
446
  The updater checks MaxMind's `Last-Modified` header and skips the download when the local copy is current; add `--force` to download anyway. Schedule it weekly or twice weekly. MaxMind requires GeoLite databases to stay current and limits GeoLite users to 30 downloads per day.
444
447
 
448
+ ### Risk data (VPN, proxy, Tor)
449
+
450
+ Location data answers "where is this address?", not "is it a VPN, proxy or Tor exit?". Neither location provider supplies risk data:
451
+
452
+ - ipapi.co's documented JSON response has no VPN, proxy or threat fields ([ipapi.co API](https://ipapi.co/api/)).
453
+ - GeoLite2 and GeoIP2 City or Country databases carry no anonymiser flags.
454
+
455
+ Up to 4.14, the plugin read a `threat` object that ipapi.co never sends and scored every local result 100. Every check below was therefore inactive, although this README described it as working. Since 4.15, these features need a **risk data source** and say so in the admin when none is set up:
456
+
457
+ | Feature | Without a risk data source |
458
+ | -------------------------------------------- | ------------------------------------------------------------------ |
459
+ | Reject suspicious sign-ins | Off and disabled; refuses nothing as suspicious. |
460
+ | Security scoring | Off and disabled; sessions store no score (`securityScore: null`). |
461
+ | Suspicious sign-in email, VPN or proxy email | Off and disabled; never sent. |
462
+ | `login.suspicious` team notification | Never sent; sign-ins post `login.new_location` or `login.success`. |
463
+ | Session details | One "Not available" row instead of score, VPN and proxy. |
464
+
465
+ #### Set up a risk data source
466
+
467
+ Configuration › Location data › **Risk data (VPN, proxy, Tor)** downloads one of two local MaxMind databases with the MaxMind credentials of the Provider and database card. The license key never reaches the browser, and lookups stay on your server: no IP address is sent anywhere.
468
+
469
+ | Database | MaxMind edition | Cost | What it detects |
470
+ | ------------------- | --------------------- | ------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
471
+ | GeoIP2 Anonymous IP | `GeoIP2-Anonymous-IP` | Paid; the download fails with "MaxMind refused the download…" if your account does not include it | VPN (`isAnonymousVpn`), public and residential proxies, Tor exit nodes, hosting providers ([MaxMind docs](https://dev.maxmind.com/geoip/docs/databases/anonymous-ip/)). An address that is not in the database is a real "clean" answer. |
472
+ | GeoLite2 ASN | `GeoLite2-ASN` | Free | Only a **heuristic**: a sign-in from a short list of large hosting and cloud networks (AWS, Google Cloud, Azure, DigitalOcean, Hetzner, OVHcloud, Linode, Vultr, Contabo, Oracle Cloud, Alibaba, Scaleway, Leaseweb, IONOS, Hostinger, M247) counts as a hosting network. It does not detect VPNs, proxies or Tor. Used only without the Anonymous IP database; with both, ASN adds the network name. |
473
+
474
+ The CLI updater downloads them too: `MAXMIND_EDITION_ID=GeoIP2-Anonymous-IP npx strapi-magic-sessionmanager-geoip` or `MAXMIND_EDITION_ID=GeoLite2-ASN …`. Each instance reads its own files, like the location database.
475
+
476
+ What the risk data does:
477
+
478
+ | Signal | Score effect | Reject suspicious sign-ins | Suspicious-sign-in email and `login.suspicious` | VPN or proxy email |
479
+ | ---------------------------------------------------- | ------------ | -------------------------------------------------------------- | ----------------------------------------------- | ------------------ |
480
+ | Tor exit node | −50 | Refused (`tor_exit_node`) | Yes | No |
481
+ | VPN | −20 | Refused (`vpn_detected`) | Yes | Yes |
482
+ | Public or residential proxy | −15 | Refused (`proxy_detected`) | Yes | Yes |
483
+ | Hosting network (Anonymous IP or ASN heuristic) | −20 | Not refused, because servers and CI jobs sign in from them too | Yes | No |
484
+ | Any anonymiser (`isAnonymous`) | −10 | Through the score only | Through the score | No |
485
+ | Score below 50 / below 70 (with Security scoring on) | | Refused below 50 | Yes below 70 | |
486
+
487
+ Lookup results keep the field names of earlier versions (`isVpn`, `isProxy`, `isThreat`, `securityScore`, `riskLevel`) and add `isTor`, `isHosting`, `isAnonymous`, `isPublicProxy`, `isResidentialProxy` and `riskSource` (`'anonymous-ip'`, `'asn-heuristic'` or `null`). `isThreat` stays `false`: MaxMind's Anonymous IP data has no threat category.
488
+
489
+ #### Upgrading from 4.14 or earlier
490
+
491
+ Saved settings are not changed: a switch that was on stays stored and applies once a source exists. Check the switches before you download a risk database: a saved "Reject suspicious sign-ins" starts refusing VPN, proxy and Tor sign-ins as soon as the file is present. One rule still depends on the saved "Reject suspicious sign-ins" value: with `geoLookupFailureMode: 'auto'`, a sign-in whose location cannot be determined is rejected while that value is on, exactly as before. The Login protection tab says so; choose **Allow sign-in** under **If the location cannot be determined** to change it.
492
+
445
493
  ---
446
494
 
447
495
  ## Login protection
@@ -451,7 +499,7 @@ Configuration › Login protection checks **new sign-ins only**. Existing sessio
451
499
  | Rule | Response | Notes |
452
500
  | ----------------------------- | ----------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
453
501
  | Temporary IP lockout | 429 with `Retry-After` | After `maxFailedLogins` failed sign-ins from one IP address within 15 minutes, that address is refused for 15 minutes. User accounts are not blocked. Shared by all server processes. Each attempt is counted before the password check, so a parallel burst cannot exceed the limit; when more attempts from one address are running at once than the limit, the extra ones get 429 with `Retry-After: 1` and no lock. |
454
- | Reject suspicious sign-ins | 403 | VPN, proxy or known threat address, or, with security scoring on, a score below 50. |
502
+ | Reject suspicious sign-ins | 403 | VPN, proxy or Tor address, or, with security scoring on, a score below 50. Needs a [risk data source](#risk-data-vpn-proxy-tor); without one this rule refuses nothing. |
455
503
  | Country rules | 403 | Allow only listed countries, or reject listed countries. With "Allow only listed countries", an empty list allows every country. |
456
504
  | Location cannot be determined | 403 "Login temporarily unavailable" | When `geoLookupFailureMode` says reject (`auto` rejects only when "Reject suspicious sign-ins" is on). |
457
505
 
@@ -463,8 +511,8 @@ Requests with an ended session get **401** with the header `X-Session-Terminated
463
511
 
464
512
  Configuration › Alerts. Both kinds are sent only when location data is available for the sign-in.
465
513
 
466
- - **Security emails to users** go to the end user's own email address, not to administrators: suspicious sign-in, sign-in from a new country (differs from the user's last 50 sessions), VPN or proxy. They use Strapi's Email plugin, so configure an email provider first (for example `@strapi/provider-email-nodemailer`).
467
- - **Team notifications** post every sign-in to Discord or Slack as `login.suspicious`, otherwise `login.new_location`, otherwise `login.success`. Only `https://discord.com`, `https://discordapp.com` and `https://hooks.slack.com` URLs are accepted; Save rejects any other URL with a field error, and an empty field clears the URL.
514
+ - **Security emails to users** go to the end user's own email address, not to administrators: suspicious sign-in, sign-in from a new country (differs from the user's last 50 sessions), VPN or proxy. Suspicious sign-in and VPN or proxy need a [risk data source](#risk-data-vpn-proxy-tor); the new-country email needs location data only. They use Strapi's Email plugin, so configure an email provider first (for example `@strapi/provider-email-nodemailer`).
515
+ - **Team notifications** post every sign-in to Discord or Slack as `login.suspicious`, otherwise `login.new_location`, otherwise `login.success`. Without a [risk data source](#risk-data-vpn-proxy-tor), `login.suspicious` is never sent. Only `https://discord.com`, `https://discordapp.com` and `https://hooks.slack.com` URLs are accepted; Save rejects any other URL with a field error, and an empty field clears the URL.
468
516
 
469
517
  Example email provider configuration:
470
518
 
@@ -637,32 +685,32 @@ The **Admin panel sessions** routes need two more permissions, which only the Su
637
685
  | `plugin::magic-sessionmanager.admin-sessions.read` | Read admin panel sessions | The Admin panel view and its two GET routes |
638
686
  | `plugin::magic-sessionmanager.admin-sessions.revoke` | Sign out admins | **Sign out** and **Sign out everywhere** (also needs read) |
639
687
 
640
- | Method | Path | Admin UI action |
641
- | -------- | -------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
642
- | GET | `/sessions` | Sessions dashboard: `?page=&pageSize=` (1-100), `status`, `reason`, `search`, `sort`; see below |
643
- | GET | `/sessions/active` | Active sessions only; same paging parameters |
644
- | GET | `/sessions/stats` | Dashboard cards and widget: counts only, cached 5 seconds per process |
645
- | GET | `/sessions/native-only/summary` | **Why?** on the untracked-session notice: counts only, no query parameters (400 otherwise) |
646
- | POST | `/sessions/native-only/end` | **End these sessions**: empty body; signed-in administrators only (admin API tokens get 403); 5 per minute |
647
- | GET | `/sessions/analytics` | Analytics page: counts and grouped counts over every session, cached 30 seconds |
648
- | GET | `/sessions/export` | Export batches of up to 1,000 rows, newest first; follow `meta.nextCursor` |
649
- | GET | `/user/:userId/sessions` | Sessions panel |
650
- | POST | `/sessions/:sessionId/terminate` | **End session** (reason `manual`; in refresh mode the Strapi session is revoked first; the record stays) |
651
- | DELETE | `/sessions/:sessionId` | **Delete record** (record removed, token stays revoked; an open session also ends) |
652
- | POST | `/sessions/clean-inactive` | **Delete ended sessions** (all users; open and idle sessions are not affected; does not run the idle check) |
653
- | POST | `/user/:userId/terminate-all` | **End all sessions** (reason `manual`) |
654
- | POST | `/user/:userId/toggle-block` | **Block user** / **Unblock user** |
655
- | GET | `/users/stats` | Widget totals (`totalUsers`, `blockedUsers`) |
656
- | GET | `/geolocation/:ipAddress` | **Look up location** |
657
- | GET | `/geoip/status` | GeoIP database status |
658
- | PUT | `/geoip/credentials` | Save or remove (`{ "clear": true }`) MaxMind credentials |
659
- | POST | `/geoip/update` | Update database / Force download |
660
- | GET, PUT | `/settings` | Configuration (PUT validates every field and returns `error.details.errors` on invalid input) |
661
- | POST | `/sessions/:sessionId/simulate-timeout` | Development only; removed when `NODE_ENV` is `production` or `staging` |
662
- | GET | `/admin-sessions/admins` | Admin panel view: `?page=&pageSize=` (1-100), `search` (up to 100 characters, name or email), `filter` (`all`, `signed-in`, `not-signed-in`); needs `admin-sessions.read` |
663
- | GET | `/admin-sessions/admins/:adminId/sessions` | **View sessions**: one entry per signed-in browser; needs `admin-sessions.read` |
664
- | POST | `/admin-sessions/admins/:adminId/sessions/:sessionId/sign-out` | **Sign out** one browser; needs `admin-sessions.revoke`; signed-in administrators only; 10 per minute |
665
- | POST | `/admin-sessions/admins/:adminId/sign-out-everywhere` | **Sign out everywhere**; needs `admin-sessions.revoke`; signed-in administrators only; 10 per minute |
688
+ | Method | Path | Admin UI action |
689
+ | -------- | -------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
690
+ | GET | `/sessions` | Sessions dashboard: `?page=&pageSize=` (1-100), `status`, `reason`, `search`, `sort`; see below |
691
+ | GET | `/sessions/active` | Active sessions only; same paging parameters |
692
+ | GET | `/sessions/stats` | Dashboard cards and widget: counts only, cached 5 seconds per process |
693
+ | GET | `/sessions/native-only/summary` | **Why?** on the untracked-session notice: counts only, no query parameters (400 otherwise) |
694
+ | POST | `/sessions/native-only/end` | **End these sessions**: empty body; signed-in administrators only (admin API tokens get 403); 5 per minute |
695
+ | GET | `/sessions/analytics` | Analytics page: counts and grouped counts over every session, cached 30 seconds |
696
+ | GET | `/sessions/export` | Export batches of up to 1,000 rows, newest first; follow `meta.nextCursor` |
697
+ | GET | `/user/:userId/sessions` | Sessions panel |
698
+ | POST | `/sessions/:sessionId/terminate` | **End session** (reason `manual`; in refresh mode the Strapi session is revoked first; the record stays) |
699
+ | DELETE | `/sessions/:sessionId` | **Delete record** (record removed, token stays revoked; an open session also ends) |
700
+ | POST | `/sessions/clean-inactive` | **Delete ended sessions** (all users; open and idle sessions are not affected; does not run the idle check) |
701
+ | POST | `/user/:userId/terminate-all` | **End all sessions** (reason `manual`) |
702
+ | POST | `/user/:userId/toggle-block` | **Block user** / **Unblock user** |
703
+ | GET | `/users/stats` | Widget totals (`totalUsers`, `blockedUsers`) |
704
+ | GET | `/geolocation/:ipAddress` | **Look up location** |
705
+ | GET | `/geoip/status` | GeoIP database status, plus `risk` (`available`, `source`, and per risk database `editionId`, `exists`, `usable`, `fromEnvironment`, `metadata`) |
706
+ | PUT | `/geoip/credentials` | Save or remove (`{ "clear": true }`) MaxMind credentials |
707
+ | POST | `/geoip/update` | Update database / Force download. Body `{ "force"?: boolean, "database"?: "location" \| "anonymous-ip" \| "asn" }` (default `location`; anything else is 400). A 401/403 from MaxMind answers 502 "MaxMind refused the download…" |
708
+ | GET, PUT | `/settings` | Configuration (PUT validates every field and returns `error.details.errors` on invalid input) |
709
+ | POST | `/sessions/:sessionId/simulate-timeout` | Development only; removed when `NODE_ENV` is `production` or `staging` |
710
+ | GET | `/admin-sessions/admins` | Admin panel view: `?page=&pageSize=` (1-100), `search` (up to 100 characters, name or email), `filter` (`all`, `signed-in`, `not-signed-in`); needs `admin-sessions.read` |
711
+ | GET | `/admin-sessions/admins/:adminId/sessions` | **View sessions**: one entry per signed-in browser; needs `admin-sessions.read` |
712
+ | POST | `/admin-sessions/admins/:adminId/sessions/:sessionId/sign-out` | **Sign out** one browser; needs `admin-sessions.revoke`; signed-in administrators only; 10 per minute |
713
+ | POST | `/admin-sessions/admins/:adminId/sign-out-everywhere` | **Sign out everywhere**; needs `admin-sessions.revoke`; signed-in administrators only; 10 per minute |
666
714
 
667
715
  **Session list parameters.** `page` (from 1), `pageSize` (1-100), `status` (`all`, `open`, `active`, `idle`, `ended`), `reason` (with `status=ended`: `logout`, `idle`, `expired`, `manual`, `blocked`, `unrecorded`), `search` (up to 100 characters; matches email, username, IP address, browser, operating system and device type) and `sort` (`loginTime:desc`, `loginTime:asc`, `lastActive:desc`, `lastActive:asc`). The response is `{ data, meta: { pagination: { page, pageSize, total, pageCount } } }` with exact totals. Unknown or out-of-range parameters return 400. Pages that start after the first 50,000 matching sessions return 400; narrow the filter or use the export, which walks every row with a cursor. Without `page` and `pageSize`, `GET /sessions` keeps the 4.x response (latest 1,000 rows, `meta.truncated`) for existing scripts.
668
716
 
@@ -1000,7 +1048,7 @@ Issues and pull requests are welcome.
1000
1048
 
1001
1049
  ## Maintenance status
1002
1050
 
1003
- Actively maintained for the Strapi 5 line. Releases are cut by semantic-release from `main` using Conventional Commits and published to npm with npm Trusted Publishing (GitHub OIDC). Dependabot proposes weekly dependency updates; patch and minor updates are merged only after lint, tests, both type checks, build and `verify` pass.
1051
+ Actively maintained for the Strapi 5 line. Releases are cut by semantic-release from `main` using Conventional Commits and published to npm with npm Trusted Publishing (GitHub OIDC). Dependabot proposes weekly dependency updates. See [Dependency updates and the auto-merge gate](#dependency-updates-and-the-auto-merge-gate).
1004
1052
 
1005
1053
  Dependency advisories (checked 2026-11-17, Strapi 5.62.0 dev baseline): `npm audit --omit=dev` on the plugin lockfile reports 5 high findings. All of them are one advisory in the Strapi 5 core dependency chain, picomatch [GHSA-fc5q-39xc-vjpf](https://github.com/advisories/GHSA-fc5q-39xc-vjpf) through `@strapi/utils` > `preferred-pm` > `find-yarn-workspace-root2` > `micromatch`. The plugin cannot fix findings in that chain; the forced npm fix would downgrade to Strapi 4, so it is not applied. They clear when Strapi ships an updated `@strapi/utils`.
1006
1054
 
@@ -1010,12 +1058,36 @@ Report bugs at https://github.com/Schero94/Magic-Sessionmanager/issues.
1010
1058
 
1011
1059
  ---
1012
1060
 
1061
+ ### Dependency updates and the auto-merge gate
1062
+
1063
+ Dependabot proposes updates weekly, after a cooldown (7 days, 14 for majors). `.github/workflows/dependency-auto-merge.yml` handles its pull requests with the rules in `.github/scripts/dependency-gate.mjs`. The script is the same in every Magic plugin repository; its unit tests run with `node --test .github/scripts/dependency-gate.test.mjs` and in CI.
1064
+
1065
+ - **Merged automatically** (squash merge by `github-actions`): an explicit patch or minor update, after the repository's own checks pass, the gate finds nothing below, and every other check on the PR head commit has finished green: every CI job and matrix entry (for example Node versions, peer floor, React 19 StrictMode) and CodeQL where present. The merge is bound to that exact commit (`--match-head-commit`).
1066
+ - **Held for review** (label `needs-review` plus a comment with the reasons, never merged automatically) when:
1067
+ - a changed package's `engines.node` no longer covers a Node version this plugin supports, or its `peerDependencies` no longer match the installed tree or this plugin's peer floor;
1068
+ - the PR body or release notes mention a breaking change;
1069
+ - the published surface changes: the `npm pack` file list (content hashes ignored), `exports`, `peerDependencies`, `engines`, or the exports of the built entry files;
1070
+ - a runtime dependency on 0.x gets a minor bump;
1071
+ - dependency review reports a vulnerability of moderate or higher, or a license outside the allowlist (MIT, MIT-0, ISC, BSD, Apache-2.0, 0BSD, BlueOak-1.0.0, CC0-1.0, Unlicense, Python-2.0, Zlib; MPL-2.0 and CC-BY for development dependencies only);
1072
+ - `npm audit signatures` reports a missing or invalid registry signature or provenance attestation;
1073
+ - the lockfile adds a package with an install script, more than 15 packages that are new to the tree, or a package that does not resolve from `registry.npmjs.org`;
1074
+ - a check fails, or the CI does not finish within 75 minutes.
1075
+ - **Major updates** get the `major-update` label and a comment; a person reads the changelog and merges by hand.
1076
+
1077
+ The gate script runs from the default branch and reads lockfiles and reports as data; it never runs code from the pull request. Only the surface job installs (without lifecycle scripts) and builds the pull request, with a read-only token. Merges made with `GITHUB_TOKEN` do not start `release.yml`, so a dependency update ships with the next regular release.
1078
+
1013
1079
  ## Languages
1014
1080
 
1015
1081
  The admin interface is available in English, German (formal "Sie"), French, Spanish and Portuguese, and follows the Strapi admin language. Dates use the admin locale.
1016
1082
 
1017
1083
  ---
1018
1084
 
1085
+ ## Showcase your company
1086
+
1087
+ Using Magic Session Manager in production? [Add your company](https://github.com/Schero94/Magic-Sessionmanager/issues/new?template=showcase.yml) to the "Used by" section of the [documentation site](https://schero94.github.io/Magic-Sessionmanager/#used-by). The form asks for the company name, the website, a logo (PNG, JPEG or WebP, uploaded to the issue) and an optional one-line description.
1088
+
1089
+ A maintainer reviews every request and approves it with the `showcase-approved` label. `.github/workflows/showcase.yml` then validates the issue with `.github/scripts/showcase.mjs`, converts the logo to a WebP of at most 320 x 160 pixels and opens a `docs:` pull request that changes `docs/site/showcase.json`. The logo appears on the site after that pull request is merged. Website links carry `rel="ugc noopener"`. To remove an entry, open an issue that names the company; a maintainer then applies the `showcase-remove` label.
1090
+
1019
1091
  ## License
1020
1092
 
1021
1093
  MIT License. Copyright © 2025 Schero D. See [LICENSE](https://github.com/Schero94/Magic-Sessionmanager/blob/main/LICENSE).
@@ -9,7 +9,7 @@ const styled = require("styled-components");
9
9
  const designSystem = require("@strapi/design-system");
10
10
  const icons = require("@strapi/icons");
11
11
  const symbols = require("@strapi/icons/symbols");
12
- const index = require("./index-CmW1DJ0c.js");
12
+ const index = require("./index-CNSJITRX.js");
13
13
  const SectionCard = require("./SectionCard-BlWv8CRt.js");
14
14
  const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
15
15
  const styled__default = /* @__PURE__ */ _interopDefault(styled);
@@ -7,7 +7,7 @@ import styled from "styled-components";
7
7
  import { Typography, Flex, LinkButton, Button, EmptyStateLayout, VisuallyHidden } from "@strapi/design-system";
8
8
  import { ArrowClockwise, ChartBubble, User, Clock, Calendar } from "@strapi/icons";
9
9
  import { EmptyDocuments } from "@strapi/icons/symbols";
10
- import { K as normalizeDeviceType, u as useSessionFormatters, l as pluginId, s as isCancelledRequest, m as logSafeAdminError, n as PersistentAlert, R as ReadableText, w as PageShell, x as StatGrid, y as StatCard, G as EqualGrid, b as getTranslation, L as getDeviceTypeMessage } from "./index-C2SrNW6I.mjs";
10
+ import { K as normalizeDeviceType, u as useSessionFormatters, l as pluginId, s as isCancelledRequest, m as logSafeAdminError, n as PersistentAlert, R as ReadableText, w as PageShell, x as StatGrid, y as StatCard, G as EqualGrid, b as getTranslation, L as getDeviceTypeMessage } from "./index-lnZBc5n0.mjs";
11
11
  import { S as SectionCard } from "./SectionCard-D51bv4Hi.mjs";
12
12
  const ANALYTICS_UNKNOWN_KEY = "unknown";
13
13
  const VERSION_TOKEN = /^v?\d[\w.]*$/i;