strapi-plugin-magic-sessionmanager 4.7.2 β 4.9.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.
- package/CHANGELOG.md +98 -0
- package/README.md +380 -663
- package/dist/admin/Analytics-B6d-39Qh.js +420 -0
- package/dist/admin/Analytics-DxOWXHn8.mjs +418 -0
- package/dist/admin/App-ZsSGj7n8.mjs +1894 -0
- package/dist/admin/App-mRFV50K6.js +1896 -0
- package/dist/admin/License-BE6UQ_V3.mjs +443 -0
- package/dist/admin/License-DXt2oi6u.js +443 -0
- package/dist/admin/OnlineUsersWidget-CFvM3Vbp.js +273 -0
- package/dist/admin/OnlineUsersWidget-_tJ6aeWl.mjs +254 -0
- package/dist/admin/SectionCard-BlWv8CRt.js +54 -0
- package/dist/admin/SectionCard-D51bv4Hi.mjs +55 -0
- package/dist/admin/Settings-BUc12TP5.js +3570 -0
- package/dist/admin/Settings-dtW7cjTX.mjs +3568 -0
- package/dist/admin/de-BFKoGEVT.js +544 -0
- package/dist/admin/de-j0oZH9Pz.mjs +544 -0
- package/dist/admin/en-UY4Tb5tE.mjs +544 -0
- package/dist/admin/en-s7Ksdkcg.js +544 -0
- package/dist/admin/es-07OGMe_5.js +544 -0
- package/dist/admin/es-DGBcZwQy.mjs +544 -0
- package/dist/admin/fr-B6-DWhGO.mjs +544 -0
- package/dist/admin/fr-ETj_2UBY.js +544 -0
- package/dist/admin/index-C_SyRULc.mjs +1750 -0
- package/dist/admin/index-D4kEnXSp.js +1751 -0
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +2 -2
- package/dist/admin/maskSensitiveValue-BWcSjow7.js +9 -0
- package/dist/admin/maskSensitiveValue-lLRhN_S7.mjs +10 -0
- package/dist/admin/pt-C7PwrQtV.js +544 -0
- package/dist/admin/pt-YMRLm9gx.mjs +544 -0
- package/dist/server/index.js +3555 -6350
- package/dist/server/index.mjs +3555 -6350
- package/package.json +30 -19
- package/pics/analytics.png +0 -0
- package/pics/dashboard-dark.png +0 -0
- package/pics/dashboard.png +0 -0
- package/pics/dashboardsessionmodal.png +0 -0
- package/pics/mobile-dashboard.png +0 -0
- package/pics/mobile-session.png +0 -0
- package/pics/sessioninfopanel.png +0 -0
- package/pics/settings1.png +0 -0
- package/pics/settings2.png +0 -0
- package/pics/widget.png +0 -0
- package/scripts/geoip-updater.cjs +266 -36
- package/scripts/update-geoip-db.mjs +3 -0
- package/dist/admin/Analytics-CsrpxJwQ.mjs +0 -497
- package/dist/admin/Analytics-D03ZNNMR.js +0 -499
- package/dist/admin/App-B2VCS3cz.js +0 -1481
- package/dist/admin/App-qxKnK7G2.mjs +0 -1479
- package/dist/admin/License-ClW7sZLR.mjs +0 -318
- package/dist/admin/License-fixnQ7wF.js +0 -320
- package/dist/admin/OnlineUsersWidget-mR_OMiwi.mjs +0 -185
- package/dist/admin/OnlineUsersWidget-qb9utPBy.js +0 -185
- package/dist/admin/Settings-U3V4eGMo.mjs +0 -2038
- package/dist/admin/Settings-gv2BF54w.js +0 -2040
- package/dist/admin/StyledButtons-Cz8oYhmc.mjs +0 -418
- package/dist/admin/StyledButtons-DDuxnYz8.js +0 -419
- package/dist/admin/de-BnqGCokx.js +0 -316
- package/dist/admin/de-JBE-iylO.mjs +0 -316
- package/dist/admin/en-BRmVwd8-.js +0 -316
- package/dist/admin/en-kQWtdEai.mjs +0 -316
- package/dist/admin/es-CH691xcL.js +0 -301
- package/dist/admin/es-DOQvBxih.mjs +0 -301
- package/dist/admin/fr-CLExO0w_.js +0 -301
- package/dist/admin/fr-CmfCpepX.mjs +0 -301
- package/dist/admin/index-B_lFjUAg.mjs +0 -551
- package/dist/admin/index-Duc7cR_d.js +0 -552
- package/dist/admin/pt-BJ_F0yNi.js +0 -301
- package/dist/admin/pt-BSzZdyAH.mjs +0 -301
- package/dist/admin/sessionStatus-D_fWEzgj.js +0 -11
- package/dist/admin/sessionStatus-kwggjEMw.mjs +0 -12
package/README.md
CHANGED
|
@@ -1,336 +1,256 @@
|
|
|
1
|
-
# Magic Session Manager
|
|
1
|
+
# Magic Session Manager
|
|
2
2
|
|
|
3
|
-
**See who
|
|
3
|
+
**See who is signed in to your Strapi app, and control their sessions.**
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Session Manager records every sign-in of your app's users (Users & Permissions) as a session and lets admins see, end and analyse them. Strapi admin accounts are not managed here.
|
|
6
6
|
|
|
7
7
|
Free and open under the MIT license. All features are available without a paid license or activation key.
|
|
8
8
|
|
|
9
9
|
[](https://www.npmjs.com/package/strapi-plugin-magic-sessionmanager)
|
|
10
10
|
[](LICENSE)
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
## πΈ What It Looks Like
|
|
15
|
-
|
|
16
|
-
### Homepage Widget - Quick Stats at a Glance
|
|
17
|
-
|
|
18
|
-

|
|
12
|
+
[Project site](https://schero94.github.io/Magic-Sessionmanager/) Β· [npm](https://www.npmjs.com/package/strapi-plugin-magic-sessionmanager) Β· [Issues](https://github.com/Schero94/Magic-Sessionmanager/issues) Β· [Changelog](CHANGELOG.md)
|
|
19
13
|
|
|
20
|
-
**
|
|
21
|
-
- See online users instantly
|
|
22
|
-
- Active in last 15/30 minutes
|
|
23
|
-
- Total users count
|
|
24
|
-
- Blocked users count
|
|
25
|
-
- No need to navigate anywhere!
|
|
14
|
+
> **Release status.** The admin UI shown here is the redesign on the branch `claude/sessionmanager-ui-redesign`, which carries the fixes for the next release. Version 4.8.0 on npm was published before its acceptance gates closed and is **not accepted**; see [Maintenance status](#maintenance-status).
|
|
26
15
|
|
|
27
16
|
---
|
|
28
17
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
-
|
|
35
|
-
-
|
|
36
|
-
-
|
|
37
|
-
-
|
|
38
|
-
-
|
|
18
|
+
## Contents
|
|
19
|
+
|
|
20
|
+
- [Screenshots](#screenshots)
|
|
21
|
+
- [Core concepts](#core-concepts)
|
|
22
|
+
- [Screens](#screens)
|
|
23
|
+
- [Compatibility](#compatibility)
|
|
24
|
+
- [Install](#install)
|
|
25
|
+
- [Session management modes](#session-management-modes)
|
|
26
|
+
- [Configuration](#configuration)
|
|
27
|
+
- [Location data and GeoIP](#location-data-and-geoip)
|
|
28
|
+
- [Login protection](#login-protection)
|
|
29
|
+
- [Alerts](#alerts)
|
|
30
|
+
- [Content API](#content-api)
|
|
31
|
+
- [Optional route policy: `session-required`](#optional-route-policy-session-required)
|
|
32
|
+
- [Admin API and permissions](#admin-api-and-permissions)
|
|
33
|
+
- [Security and privacy](#security-and-privacy)
|
|
34
|
+
- [Troubleshooting](#troubleshooting)
|
|
35
|
+
- [Development and tests](#development-and-tests)
|
|
36
|
+
- [Maintenance status](#maintenance-status)
|
|
37
|
+
- [Languages](#languages)
|
|
38
|
+
- [License](#license)
|
|
39
39
|
|
|
40
40
|
---
|
|
41
41
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-

|
|
42
|
+
## Screenshots
|
|
45
43
|
|
|
46
|
-
|
|
47
|
-
- Full device information
|
|
48
|
-
- Browser and operating system
|
|
49
|
-
- Complete session history
|
|
50
|
-
- IP geolocation
|
|
51
|
-
- Security risk score
|
|
44
|
+
All screenshots use synthetic data: users `*.example.test`, IP addresses from the documentation range `203.0.113.0/24`, Strapi 5.61.
|
|
52
45
|
|
|
53
|
-
|
|
46
|
+
### Sessions dashboard
|
|
54
47
|
|
|
55
|
-
|
|
48
|
+

|
|
56
49
|
|
|
57
|
-
|
|
50
|
+
Dark mode:
|
|
58
51
|
|
|
59
|
-
|
|
60
|
-
- Sidebar shows their active sessions
|
|
61
|
-
- Quick actions (terminate, block)
|
|
62
|
-
- Offline/Online status indicator
|
|
63
|
-
- No need to leave the page!
|
|
52
|
+

|
|
64
53
|
|
|
65
|
-
|
|
54
|
+
### Session details
|
|
66
55
|
|
|
67
|
-
|
|
56
|
+

|
|
68
57
|
|
|
69
|
-
|
|
58
|
+
### Sessions panel in the Content Manager
|
|
70
59
|
|
|
71
|
-
|
|
72
|
-
- Session timeouts
|
|
73
|
-
- Rate limiting
|
|
74
|
-
- Email alerts
|
|
75
|
-
- Webhook notifications
|
|
76
|
-
- Geo-blocking rules
|
|
60
|
+

|
|
77
61
|
|
|
78
|
-
|
|
62
|
+
### Homepage widget
|
|
79
63
|
|
|
80
|
-
|
|
81
|
-
- Encryption key generator (one click!)
|
|
82
|
-
- Country allow/block lists
|
|
83
|
-
- VPN detection
|
|
84
|
-
- Threat blocking
|
|
64
|
+

|
|
85
65
|
|
|
86
|
-
|
|
66
|
+
### Configuration
|
|
87
67
|
|
|
88
|
-
|
|
68
|
+

|
|
89
69
|
|
|
90
|
-
|
|
70
|
+

|
|
91
71
|
|
|
92
|
-
|
|
93
|
-
- Plugin saves who logged in, when, and from where
|
|
94
|
-
- You can see them in the dashboard (see screenshot above)
|
|
95
|
-
- You can force-logout anyone anytime
|
|
72
|
+
### Analytics
|
|
96
73
|
|
|
97
|
-
|
|
98
|
-
- Plugin marks their session as "logged out"
|
|
99
|
-
- They disappear from the active sessions list
|
|
100
|
-
- Manual logout permanently blocks session reactivation (security feature)
|
|
74
|
+

|
|
101
75
|
|
|
102
|
-
|
|
103
|
-
- **Timeout:** Session can be reactivated on next request (seamless UX)
|
|
104
|
-
- **Manual Logout:** Session is permanently terminated (security-first)
|
|
76
|
+
### Mobile (390 px)
|
|
105
77
|
|
|
106
|
-
|
|
107
|
-
-
|
|
108
|
-
-
|
|
78
|
+
<p>
|
|
79
|
+
<img src="pics/mobile-dashboard.png" width="300" alt="Sessions dashboard at 390 px: the table becomes a card list with Details, End session and More buttons">
|
|
80
|
+
<img src="pics/mobile-session.png" width="300" alt="Session details dialog at 390 px in one column with Close and End session in the footer">
|
|
81
|
+
</p>
|
|
109
82
|
|
|
110
83
|
---
|
|
111
84
|
|
|
112
|
-
##
|
|
113
|
-
|
|
114
|
-
### Step 1: Install
|
|
115
|
-
|
|
116
|
-
```bash
|
|
117
|
-
npm install strapi-plugin-magic-sessionmanager
|
|
118
|
-
```
|
|
85
|
+
## Core concepts
|
|
119
86
|
|
|
120
|
-
|
|
87
|
+
**Session.** One sign-in of a user on one device, from sign-in until it ends. Every session has a **session record** with times, device, IP address and location.
|
|
121
88
|
|
|
122
|
-
|
|
89
|
+
**A session is in one of three states:**
|
|
123
90
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
});
|
|
130
|
-
```
|
|
91
|
+
| State | Meaning |
|
|
92
|
+
| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
93
|
+
| **Active** | Open and used within the inactivity timeout. |
|
|
94
|
+
| **Idle** | Open, but not used for longer than the inactivity timeout. It ends on its next request or at the next idle check. A token refresh makes it active again. |
|
|
95
|
+
| **Ended** | The session can no longer be used. The user has to sign in again on this device. |
|
|
131
96
|
|
|
132
|
-
|
|
97
|
+
**An ended session always shows its end reason:**
|
|
133
98
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
99
|
+
| End reason | Stored value | Meaning |
|
|
100
|
+
| ------------------- | ------------ | ----------------------------------------------------------------------------------------------------------------------------------------- |
|
|
101
|
+
| Logged out | `logout` | The user signed out. |
|
|
102
|
+
| Timed out | `idle` | Not used for longer than the inactivity timeout. |
|
|
103
|
+
| Expired | `expired` | Reached the maximum session age. |
|
|
104
|
+
| Ended manually | `manual` | Ended from the Strapi admin, or by the user from another of their devices. |
|
|
105
|
+
| User blocked | `blocked` | Ended because the user account was blocked. |
|
|
106
|
+
| Reason not recorded | (none) | No end reason was stored, for example because the session ended in Strapi's own session store or was recorded by an older plugin version. |
|
|
138
107
|
|
|
139
|
-
|
|
108
|
+
**Three verbs, three meanings:**
|
|
140
109
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
4. You'll see the dashboard (like the screenshot above)
|
|
110
|
+
- **End** a session: it stops working, the record stays in the history.
|
|
111
|
+
- **Delete record**: the record is removed from history, statistics and exports. If the session is still open, it also ends. Its token stays revoked.
|
|
112
|
+
- **Block** a user: the user cannot sign in, and all open sessions end. **Unblock** allows sign-in again but does not restore ended sessions.
|
|
145
113
|
|
|
146
|
-
**
|
|
114
|
+
**Online** describes users, never sessions: a user is online when at least one of their sessions is Active. The dashboard, the widget and the user panel all use this one rule, based on the configured inactivity timeout.
|
|
147
115
|
|
|
148
116
|
---
|
|
149
117
|
|
|
150
|
-
##
|
|
118
|
+
## Screens
|
|
151
119
|
|
|
152
|
-
|
|
120
|
+
| Where | Name | Answers |
|
|
121
|
+
| ------------------------------- | ------------------------------------------- | --------------------------------------------------------- |
|
|
122
|
+
| Main menu | **Session Manager** (page title "Sessions") | Which sessions exist, and which need action? |
|
|
123
|
+
| Dialog on the dashboard | **Session details** | What is this session, and why is it in this state? |
|
|
124
|
+
| Content Manager, User edit view | **Sessions** panel | What access does this user have, and how do I cut it off? |
|
|
125
|
+
| Strapi homepage | **Online users** widget | Who is online right now? |
|
|
126
|
+
| Settings βΊ Session Manager | **Configuration** | How should sessions and sign-ins behave? |
|
|
127
|
+
| Settings βΊ Session Manager | **Analytics** | How are sessions used over time and by device? |
|
|
128
|
+
| Settings βΊ Session Manager | **License** | Is a license key stored, and is it valid? |
|
|
153
129
|
|
|
154
|
-
|
|
130
|
+
### Sessions dashboard
|
|
155
131
|
|
|
156
|
-
**
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
132
|
+
- **Header:** title "Sessions", the links **Analytics** and **Settings** (opens Configuration), and **Export** (CSV or JSON of the filtered list across all pages, with an "End reason" column and never any tokens).
|
|
133
|
+
- **How sessions work:** a collapsed legend of the three states.
|
|
134
|
+
- **Four stat cards** that set the status filter: **Active** ("{n} users online"), **Idle**, **Ended** ("{a} logged out Β· {b} timed out Β· {c} other reasons") and **All**.
|
|
135
|
+
- **Action bar:** search by user, email, IP or device; **Status** filter (All sessions, Open, Active, Idle, Ended); an **End reason** filter when Ended is selected; Refresh. "Last updated" shows when the list was loaded; it also refreshes every 10 minutes.
|
|
136
|
+
- **Table:** Status (badge and a second line, for example "Ended manually Β· {date}"), User, Device, IP address, Signed in, Last active and the row actions **View details**, **End session** (disabled on ended rows) and **More actions βΊ Delete record**. Clicking a row opens the details.
|
|
137
|
+
- Filters, search, page and page size are kept in the URL, so `?search=<email>` is a shareable link.
|
|
138
|
+
- When more than 1,000 sessions exist, an alert says that counts, filters and exports cover the latest 1,000 only.
|
|
139
|
+
- Below the large breakpoint the IP address and Signed in columns are hidden; below the medium breakpoint the table becomes a card list.
|
|
163
140
|
|
|
164
|
-
|
|
165
|
-
```bash
|
|
166
|
-
node -e "console.log(require('crypto').randomBytes(32).toString('base64'))"
|
|
167
|
-
```
|
|
141
|
+
### Session details
|
|
168
142
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
143
|
+
- A state sentence that explains why the session is in its state, for example "Ended {time} Β· Ended manually."
|
|
144
|
+
- **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).
|
|
145
|
+
- **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.
|
|
146
|
+
- **Technical details** (collapsed): record ID with a copy button and the raw user agent.
|
|
147
|
+
- Footer: **End session** with confirmation on open sessions; ended sessions show "This session has already ended."
|
|
173
148
|
|
|
174
|
-
|
|
149
|
+
### Sessions panel (Content Manager)
|
|
175
150
|
|
|
176
|
-
|
|
151
|
+
Shown on the edit view of a Users & Permissions user only.
|
|
177
152
|
|
|
178
|
-
|
|
153
|
+
- **Online** or **Not online**, "{n} open sessions" (active or idle) and the last activity.
|
|
154
|
+
- **End all sessions:** signs the user out on every device. The user can sign in again unless the account is blocked.
|
|
155
|
+
- **Block user** / **Unblock user:** blocking ends all open sessions and prevents sign-in. The open form's Blocked field is updated, so a later Save does not undo it. Setting the native Blocked field and saving has the same effect.
|
|
156
|
+
- Up to five open sessions, then **Show all sessions**, which opens the dashboard filtered by the user's email.
|
|
157
|
+
- For an unsaved user the panel only says "Save this user before you can manage sessions."
|
|
179
158
|
|
|
180
|
-
###
|
|
159
|
+
### Online users widget
|
|
181
160
|
|
|
182
|
-
**
|
|
183
|
-
- Shows all active users
|
|
184
|
-
- Green badge = currently online
|
|
185
|
-
- Gray badge = logged out
|
|
186
|
-
- Click to see details
|
|
161
|
+
Strapi 5.13 and later. Four tiles: **Online users** (of all registered users), **Active sessions**, **Idle sessions** and **Blocked users**, plus a link **Open Session Manager**. The widget refreshes every 30 seconds.
|
|
187
162
|
|
|
188
|
-
###
|
|
163
|
+
### Settings βΊ Session Manager
|
|
189
164
|
|
|
190
|
-
**
|
|
191
|
-
1. Find their session
|
|
192
|
-
2. Click **"Terminate"**
|
|
193
|
-
3. Done! They're logged out immediately
|
|
165
|
+
Three links: **Configuration**, **Analytics** and **License**.
|
|
194
166
|
|
|
195
|
-
**
|
|
167
|
+
**Configuration** has five tabs, deep-linkable with `?tab=sessions|login-protection|location-data|alerts|data-retention`:
|
|
196
168
|
|
|
197
|
-
|
|
169
|
+
| Tab | Question | Contents |
|
|
170
|
+
| ---------------------- | --------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
171
|
+
| **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. |
|
|
172
|
+
| **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. |
|
|
173
|
+
| **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. |
|
|
174
|
+
| **Alerts** | Who is told about sign-ins? | Security emails to users (with email templates) and Team notifications to Discord or Slack. |
|
|
175
|
+
| **Data and retention** | How long is session history kept? | Keep ended sessions for, and **Delete ended sessions**. |
|
|
198
176
|
|
|
199
|
-
**
|
|
200
|
-
- When they logged in
|
|
201
|
-
- Last time they did something
|
|
202
|
-
- What browser/device they use
|
|
203
|
-
- Their IP address
|
|
204
|
-
- Location
|
|
177
|
+
**Save** applies the whole form; **Discard changes** re-loads the stored values (it does not restore defaults). Leaving with unsaved changes asks first. Settings are saved in the database; other server processes apply them within 30 seconds.
|
|
205
178
|
|
|
206
|
-
|
|
179
|
+
**Analytics** shows All sessions, Active sessions, Sign-ins in the last 24 hours and in the last 7 days (rolling windows), sessions by device and by browser, and the average session length, all from the latest loaded sessions.
|
|
207
180
|
|
|
208
|
-
**
|
|
209
|
-
- Desktop computer
|
|
210
|
-
- Phone
|
|
211
|
-
- Tablet
|
|
212
|
-
- All at the same time!
|
|
181
|
+
**License** shows whether an optional license key is stored and whether it is valid. It is read-only. All features are available with or without a key.
|
|
213
182
|
|
|
214
|
-
|
|
183
|
+
---
|
|
215
184
|
|
|
216
|
-
|
|
185
|
+
## Compatibility
|
|
217
186
|
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
187
|
+
| Item | Supported |
|
|
188
|
+
| ----------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
189
|
+
| Strapi | 5 (`@strapi/strapi` peer range `^5.0.0`). Acceptance host: Strapi 5.61.0. |
|
|
190
|
+
| Node.js | `^22.22.2 \|\| >=24.15.0` (`engines.node`) |
|
|
191
|
+
| Users & Permissions | `jwtManagement: 'refresh'` and `'legacy-support'` |
|
|
192
|
+
| Homepage widget | Strapi 5.13 and later (older versions have no widgets API; the rest works) |
|
|
193
|
+
| Admin peer dependencies | `@strapi/design-system` `^2.0.0`, `@strapi/icons` `^2.0.0`, `react` / `react-dom` `^18.3.1`, `react-intl` `^6.0.0`, `react-router-dom` `^6.0.0`, `styled-components` `^6.0.0` |
|
|
222
194
|
|
|
223
195
|
---
|
|
224
196
|
|
|
225
|
-
##
|
|
197
|
+
## Install
|
|
226
198
|
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
```
|
|
230
|
-
Admin kicks out a user
|
|
231
|
-
β
|
|
232
|
-
User has "refresh token"
|
|
233
|
-
β
|
|
234
|
-
User gets new login token automatically
|
|
235
|
-
β
|
|
236
|
-
User is back in! π±
|
|
199
|
+
```bash
|
|
200
|
+
npm install strapi-plugin-magic-sessionmanager
|
|
237
201
|
```
|
|
238
202
|
|
|
239
|
-
|
|
203
|
+
Enable it in `config/plugins.ts`:
|
|
240
204
|
|
|
205
|
+
```typescript
|
|
206
|
+
export default () => ({
|
|
207
|
+
'magic-sessionmanager': {
|
|
208
|
+
enabled: true,
|
|
209
|
+
},
|
|
210
|
+
});
|
|
241
211
|
```
|
|
242
|
-
Admin kicks out a user
|
|
243
|
-
β
|
|
244
|
-
User tries to use refresh token
|
|
245
|
-
β
|
|
246
|
-
Plugin blocks it! π«
|
|
247
|
-
β
|
|
248
|
-
User MUST login again
|
|
249
|
-
```
|
|
250
|
-
|
|
251
|
-
**How to enable:**
|
|
252
212
|
|
|
253
|
-
|
|
213
|
+
Set the encryption key (required when `NODE_ENV=production`, see [Security and privacy](#security-and-privacy)), then rebuild and start:
|
|
254
214
|
|
|
255
|
-
```
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
jwtManagement: 'refresh', // Enable refresh tokens
|
|
259
|
-
sessions: {
|
|
260
|
-
accessTokenLifespan: 3600, // 1 hour
|
|
261
|
-
maxRefreshTokenLifespan: 2592000, // 30 days
|
|
262
|
-
},
|
|
263
|
-
},
|
|
264
|
-
}
|
|
215
|
+
```bash
|
|
216
|
+
npm run build
|
|
217
|
+
npm run develop
|
|
265
218
|
```
|
|
266
219
|
|
|
267
|
-
**
|
|
268
|
-
- Users stay logged in longer (better experience)
|
|
269
|
-
- But admins can still force-logout completely (better security)
|
|
270
|
-
- Best of both worlds! β
|
|
220
|
+
Open the Strapi admin and select **Session Manager** in the main menu. Super Admins have access automatically; for other admin roles, grant **Plugins βΊ Session Manager βΊ Access the Session Manager plugin** under Settings βΊ Administration Panel βΊ Roles.
|
|
271
221
|
|
|
272
222
|
---
|
|
273
223
|
|
|
274
|
-
##
|
|
275
|
-
|
|
276
|
-
### IP Geolocation
|
|
224
|
+
## Session management modes
|
|
277
225
|
|
|
278
|
-
|
|
279
|
-
- Country (with flag! π©πͺπΊπΈπ¬π§)
|
|
280
|
-
- City
|
|
281
|
-
- ISP Provider
|
|
282
|
-
- Coordinates (for map)
|
|
226
|
+
Session Manager supports Users & Permissions end-user sessions in both the native refresh mode and the `legacy-support` mode.
|
|
283
227
|
|
|
284
|
-
###
|
|
228
|
+
### Native Users & Permissions sessions (`jwtManagement: 'refresh'`)
|
|
285
229
|
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
230
|
+
```typescript
|
|
231
|
+
'users-permissions': {
|
|
232
|
+
config: {
|
|
233
|
+
jwtManagement: 'refresh',
|
|
234
|
+
},
|
|
235
|
+
}
|
|
236
|
+
```
|
|
291
237
|
|
|
292
|
-
|
|
293
|
-
https://dev.maxmind.com/geoip/geolite2-free-geolocation-data/
|
|
294
|
-
2. Store the file on your Strapi server, for example:
|
|
295
|
-
`/var/lib/strapi/GeoLite2-City.mmdb`
|
|
296
|
-
3. Configure the plugin:
|
|
238
|
+
In this mode Strapi issues, rotates and revokes native sessions. Session Manager uses that state for end-user sessions and keeps its own metadata and history (device, IP address, location, security score). It does not issue or rotate a second token family. Rows created natively without a Session Manager record can appear with a `native_` ID; the admin marks them as "Strapi session", and their device, IP address and location are shown as "β" ("Not recorded").
|
|
297
239
|
|
|
298
|
-
|
|
299
|
-
MAGIC_SESSIONMANAGER_GEOIP_DATABASE=/var/lib/strapi/GeoLite2-City.mmdb
|
|
300
|
-
MAXMIND_EDITION_ID=GeoLite2-City
|
|
301
|
-
MAXMIND_ACCOUNT_ID=your-account-id
|
|
302
|
-
MAXMIND_LICENSE_KEY=your-license-key
|
|
303
|
-
```
|
|
240
|
+
### `legacy-support` mode
|
|
304
241
|
|
|
305
|
-
|
|
306
|
-
**Magic Session Manager -> Settings -> Geofencing**, choose `local-mmdb`,
|
|
307
|
-
enter the MaxMind account ID and license key, then use **Download / Update DB**.
|
|
308
|
-
The plugin stores the credentials in the Strapi plugin store and never returns
|
|
309
|
-
the license key to the browser after saving it.
|
|
242
|
+
With `jwtManagement: 'legacy-support'`, Session Manager keeps its plugin-owned session behavior. It does not switch the host to refresh mode or migrate existing session records.
|
|
310
243
|
|
|
311
|
-
|
|
312
|
-
credentials via environment variables (the in-admin updater stores them in the
|
|
313
|
-
Strapi plugin store instead):
|
|
244
|
+
In both modes the existing Magic endpoints keep their paths, methods, permissions and response envelopes. The plugin does not change the host application's authentication configuration or migrate existing session records. Strapi administrator-account sessions are not managed by this plugin. The default Content API permission setup targets only the Authenticated role and never adds these actions to Public. If an administrator saves the Authenticated role before the first protected request, the plugin keeps that role's permission choices.
|
|
314
245
|
|
|
315
|
-
|
|
316
|
-
export MAXMIND_ACCOUNT_ID=your_account_id
|
|
317
|
-
export MAXMIND_LICENSE_KEY=your_license_key
|
|
318
|
-
export MAXMIND_EDITION_ID=GeoLite2-City
|
|
319
|
-
npm run geoip:update
|
|
320
|
-
```
|
|
246
|
+
---
|
|
321
247
|
|
|
322
|
-
|
|
248
|
+
## Configuration
|
|
323
249
|
|
|
324
|
-
|
|
325
|
-
npx strapi-magic-sessionmanager-geoip
|
|
326
|
-
```
|
|
250
|
+
Settings come from two places:
|
|
327
251
|
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
plugin repo or `npx strapi-magic-sessionmanager-geoip --force` in an installed
|
|
331
|
-
Strapi project to force a refresh. Schedule it weekly or twice weekly with
|
|
332
|
-
cron/systemd. MaxMind requires GeoLite databases to stay up to date and
|
|
333
|
-
currently limits GeoLite users to 30 database downloads per day.
|
|
252
|
+
1. **Static config** in `config/plugins.ts` (`config` below). Time values are in **milliseconds**.
|
|
253
|
+
2. **Admin settings** (Settings βΊ Session Manager βΊ Configuration), stored in the plugin store in user-facing units (minutes, seconds, days). **A value saved in the admin overrides the static config.** Once the Configuration page has been saved, every field shown there comes from the stored settings.
|
|
334
254
|
|
|
335
255
|
```typescript
|
|
336
256
|
// config/plugins.ts
|
|
@@ -338,530 +258,327 @@ export default () => ({
|
|
|
338
258
|
'magic-sessionmanager': {
|
|
339
259
|
enabled: true,
|
|
340
260
|
config: {
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
261
|
+
inactivityTimeout: 15 * 60 * 1000, // ms
|
|
262
|
+
lastSeenRateLimit: 30 * 1000, // ms
|
|
263
|
+
cleanupInterval: 30 * 60 * 1000, // ms
|
|
264
|
+
maxSessionAgeDays: 30,
|
|
265
|
+
retentionDays: 90, // -1 keeps ended sessions forever
|
|
266
|
+
strictSessionEnforcement: false,
|
|
267
|
+
geoIpProvider: 'auto', // 'auto' | 'local-mmdb' | 'ipapi' | 'disabled'
|
|
268
|
+
geoLookupFailureMode: 'auto', // 'auto' | 'allow' | 'block'
|
|
349
269
|
},
|
|
350
270
|
},
|
|
351
271
|
});
|
|
352
272
|
```
|
|
353
273
|
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
274
|
+
### Reference
|
|
275
|
+
|
|
276
|
+
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.
|
|
277
|
+
|
|
278
|
+
| Key | Default | Admin unit and range | Configuration tab | Meaning |
|
|
279
|
+
| ------------------------------------------------------------------- | --------------------------------------------- | ----------------------------------------------------------------- | ----------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
280
|
+
| `inactivityTimeout` | 15 min (`900000` ms) | min, 1β1440 | Sessions | Unused this long, a session becomes idle and then ends as "Timed out". Also decides who counts as online. |
|
|
281
|
+
| `maxSessionAgeDays` | 30 | days, 1β365 | Sessions | Maximum age from sign-in, regardless of activity. Applied on the session's next request. |
|
|
282
|
+
| `lastSeenRateLimit` | 30 s (`30000` ms) | s, 5β300 | Sessions βΊ Advanced | Minimum interval between "Last active" updates. |
|
|
283
|
+
| `cleanupInterval` | 30 min (`1800000` ms) | min, 5β1440 | Sessions βΊ Advanced | How often the idle check runs. It ends idle sessions and deletes nothing. It also runs once at server start. |
|
|
284
|
+
| `cleanupUseDbDirect` | `false` | boolean | Sessions βΊ Advanced | Idle check with one SQL update instead of the Document Service (skips lifecycle hooks). |
|
|
285
|
+
| `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. |
|
|
286
|
+
| `sessionCreationGraceMs` | `5000` | ms, 0β30000 (shown in seconds) | Sessions βΊ Advanced | Window after sign-in in which a token is accepted while its record is being created. |
|
|
287
|
+
| `maxFailedLogins` | 5 | 0β100, 0 = off | Login protection | Temporary IP lockout threshold (failed sign-ins from one IP within 15 minutes). |
|
|
288
|
+
| `trustedProxies` | off | boolean | Login protection | Read the client IP from proxy headers. Only behind a proxy you control. |
|
|
289
|
+
| `blockSuspiciousSessions` | `false` | boolean | Login protection | Reject suspicious sign-ins. |
|
|
290
|
+
| `geoLookupFailureMode` | `'auto'` | auto, allow, block | Login protection | What happens when the location cannot be determined. |
|
|
291
|
+
| `enableGeofencing` | `false` | boolean | Login protection | Use country rules. |
|
|
292
|
+
| `allowedCountries` / `blockedCountries` | `[]` | ISO 3166-1 alpha-2 codes | Login protection | Allow only listed countries / Reject listed countries. |
|
|
293
|
+
| `enableGeolocation` | `true` | boolean | Location data | IP location lookup at sign-in. Required by country rules, suspicious-sign-in checks and alerts. |
|
|
294
|
+
| `enableSecurityScoring` | `true` | boolean | Location data | Apply the security score thresholds (below 70: suspicious-sign-in email, below 50: rejection if enabled). |
|
|
295
|
+
| `geoIpProvider` | `'auto'` | auto, local-mmdb, ipapi, disabled | Location data | Where location data comes from. |
|
|
296
|
+
| `geoIpDatabasePath` | `MAGIC_SESSIONMANAGER_GEOIP_DATABASE` or `''` | file name | Location data βΊ Advanced | Local MaxMind-compatible database. |
|
|
297
|
+
| `enableEmailAlerts` | `false` | boolean | Alerts | Security emails to users. |
|
|
298
|
+
| `alertOnSuspiciousLogin` / `alertOnNewLocation` / `alertOnVpnProxy` | `true` | boolean | Alerts | Which events send an email. |
|
|
299
|
+
| `enableWebhooks` | `false` | boolean | Alerts | Team notifications. |
|
|
300
|
+
| `discordWebhookUrl` / `slackWebhookUrl` | `''` | https URL on discord.com / discordapp.com, or hooks.slack.com | Alerts | Any other host is rejected. |
|
|
301
|
+
| `retentionDays` | 90 | days, 1β365 or -1 (forever) | Data and retention | How long records of ended sessions are kept. Checked once a day, the first time about 24 hours after the server starts. Open sessions are never deleted by retention. |
|
|
302
|
+
| `rateLimitWriteMax` / `rateLimitReadMax` / `rateLimitWindowSeconds` | 10 / 120 / 60 | 1β1000 / 1β10000 / 10β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. |
|
|
303
|
+
| `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. |
|
|
304
|
+
|
|
305
|
+
### Environment variables
|
|
306
|
+
|
|
307
|
+
| Variable | Purpose |
|
|
308
|
+
| ------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
309
|
+
| `SESSION_ENCRYPTION_KEY` | Key for AES-256-GCM encryption of stored tokens. Required when `NODE_ENV=production` (startup fails without it). Keep it stable. |
|
|
310
|
+
| `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`). |
|
|
311
|
+
| `MAXMIND_ACCOUNT_ID`, `MAXMIND_LICENSE_KEY` | MaxMind credentials for database updates. They take precedence over credentials stored in the admin. |
|
|
312
|
+
| `MAXMIND_EDITION_ID` | Edition for the CLI updater, for example `GeoLite2-City`. |
|
|
365
313
|
|
|
366
|
-
|
|
314
|
+
---
|
|
367
315
|
|
|
368
|
-
|
|
369
|
-
- VPN
|
|
370
|
-
- Proxy
|
|
371
|
-
- Known threat
|
|
372
|
-
- Security score (0-100)
|
|
316
|
+
## Location data and GeoIP
|
|
373
317
|
|
|
374
|
-
###
|
|
318
|
+
### IP geolocation
|
|
375
319
|
|
|
376
|
-
|
|
377
|
-
- Specific countries
|
|
378
|
-
- VPNs or proxies
|
|
379
|
-
- Low security score IPs
|
|
380
|
-
- Known threat IPs
|
|
320
|
+
IP geolocation is enabled by default and the default provider is `auto`. When no local database is available, `auto` sends the session IP address to ipapi.co for a lookup. If a local lookup fails, `auto` can also send the IP address to ipapi.co. With `geoLookupFailureMode: 'block'`, a failed local lookup does not fall back to ipapi.co. This setting does not prevent the remote lookup when no local database is available.
|
|
381
321
|
|
|
382
|
-
|
|
322
|
+
| Provider | Behavior |
|
|
323
|
+
| ------------ | ------------------------------------------------------------------------ |
|
|
324
|
+
| `auto` | Local database when available, with the remote fallback described above. |
|
|
325
|
+
| `local-mmdb` | Local MaxMind-compatible database only. |
|
|
326
|
+
| `ipapi` | Always sends the IP address to ipapi.co. |
|
|
327
|
+
| `disabled` | No lookup. |
|
|
383
328
|
|
|
384
|
-
|
|
385
|
-
- Suspicious login detected
|
|
386
|
-
- VPN used
|
|
387
|
-
- New location login
|
|
388
|
-
- Send to Discord or Slack!
|
|
329
|
+
To avoid remote IP lookups, choose `local-mmdb`, which uses a local database and does not fall back to ipapi.co. Choose `disabled` for no GeoIP lookup, or set `enableGeolocation: false` for no GeoIP lookup. Country rules, suspicious-sign-in checks and alerts need location data, so these choices also affect them.
|
|
389
330
|
|
|
390
|
-
|
|
331
|
+
The MaxMind database download is a separate authenticated network request; the MaxMind database download does not send end-user session IP addresses. Local lookups use the downloaded database without contacting MaxMind.
|
|
391
332
|
|
|
392
|
-
|
|
333
|
+
### Local MaxMind database (recommended)
|
|
393
334
|
|
|
394
|
-
|
|
335
|
+
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.
|
|
395
336
|
|
|
396
|
-
|
|
337
|
+
1. Create a free MaxMind account: https://dev.maxmind.com/geoip/geolite2-free-geolocation-data/
|
|
338
|
+
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.
|
|
397
339
|
|
|
398
|
-
|
|
340
|
+
Or use the CLI updater with environment variables:
|
|
399
341
|
|
|
400
|
-
**Option A: Nodemailer (Recommended)**
|
|
401
342
|
```bash
|
|
402
|
-
|
|
343
|
+
export MAXMIND_ACCOUNT_ID=your_account_id
|
|
344
|
+
export MAXMIND_LICENSE_KEY=your_license_key
|
|
345
|
+
export MAXMIND_EDITION_ID=GeoLite2-City
|
|
346
|
+
npx strapi-magic-sessionmanager-geoip # in a Strapi project
|
|
347
|
+
npm run geoip:update # in the plugin repository
|
|
403
348
|
```
|
|
404
349
|
|
|
405
|
-
|
|
406
|
-
```bash
|
|
407
|
-
npm install @strapi/provider-email-sendgrid
|
|
408
|
-
```
|
|
350
|
+
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.
|
|
409
351
|
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
352
|
+
---
|
|
353
|
+
|
|
354
|
+
## Login protection
|
|
355
|
+
|
|
356
|
+
Configuration βΊ Login protection checks **new sign-ins only**. Existing sessions are not affected, and refused sign-ins are not recorded.
|
|
414
357
|
|
|
415
|
-
|
|
358
|
+
| Rule | Response | Notes |
|
|
359
|
+
| ----------------------------- | ----------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
360
|
+
| 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. Counted per server process. |
|
|
361
|
+
| Reject suspicious sign-ins | 403 | VPN, proxy or known threat address, or, with security scoring on, a score below 50. |
|
|
362
|
+
| Country rules | 403 | Allow only listed countries, or reject listed countries. With "Allow only listed countries", an empty list allows every country. |
|
|
363
|
+
| Location cannot be determined | 403 "Login temporarily unavailable" | When `geoLookupFailureMode` says reject (`auto` rejects only when "Reject suspicious sign-ins" is on). |
|
|
416
364
|
|
|
417
|
-
|
|
365
|
+
Requests with an ended session get **401** with the header `X-Session-Terminated-Reason` (`logout`, `manual`, `idle`, `expired` or `blocked`).
|
|
366
|
+
|
|
367
|
+
---
|
|
368
|
+
|
|
369
|
+
## Alerts
|
|
370
|
+
|
|
371
|
+
Configuration βΊ Alerts. Both kinds are sent only when location data is available for the sign-in.
|
|
372
|
+
|
|
373
|
+
- **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`).
|
|
374
|
+
- **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.
|
|
375
|
+
|
|
376
|
+
Example email provider configuration:
|
|
418
377
|
|
|
419
378
|
```typescript
|
|
420
|
-
|
|
421
|
-
|
|
379
|
+
// config/plugins.ts
|
|
380
|
+
export default ({ env }) => ({
|
|
422
381
|
email: {
|
|
423
382
|
config: {
|
|
424
383
|
provider: 'nodemailer',
|
|
425
384
|
providerOptions: {
|
|
426
|
-
host:
|
|
427
|
-
port:
|
|
428
|
-
auth: {
|
|
429
|
-
user: process.env.SMTP_USER,
|
|
430
|
-
pass: process.env.SMTP_PASSWORD,
|
|
431
|
-
},
|
|
385
|
+
host: env('SMTP_HOST'),
|
|
386
|
+
port: env.int('SMTP_PORT', 587),
|
|
387
|
+
auth: { user: env('SMTP_USER'), pass: env('SMTP_PASSWORD') },
|
|
432
388
|
},
|
|
433
389
|
settings: {
|
|
434
|
-
defaultFrom:
|
|
435
|
-
defaultReplyTo:
|
|
390
|
+
defaultFrom: env('SMTP_DEFAULT_FROM'),
|
|
391
|
+
defaultReplyTo: env('SMTP_DEFAULT_REPLY_TO'),
|
|
436
392
|
},
|
|
437
393
|
},
|
|
438
394
|
},
|
|
439
|
-
|
|
440
|
-
// Session Manager configuration
|
|
441
|
-
'magic-sessionmanager': {
|
|
442
|
-
enabled: true,
|
|
443
|
-
},
|
|
395
|
+
'magic-sessionmanager': { enabled: true },
|
|
444
396
|
});
|
|
445
397
|
```
|
|
446
398
|
|
|
447
|
-
### Step 3: Add Environment Variables
|
|
448
|
-
|
|
449
|
-
Add to your `.env` file:
|
|
450
|
-
|
|
451
|
-
```env
|
|
452
|
-
SMTP_HOST=smtp.gmail.com
|
|
453
|
-
SMTP_PORT=587
|
|
454
|
-
SMTP_USER=your-email@gmail.com
|
|
455
|
-
SMTP_PASSWORD=your-app-password
|
|
456
|
-
SMTP_DEFAULT_FROM=noreply@yourapp.com
|
|
457
|
-
SMTP_DEFAULT_REPLY_TO=support@yourapp.com
|
|
458
|
-
```
|
|
459
|
-
|
|
460
|
-
**For Gmail:**
|
|
461
|
-
- Use an [App Password](https://support.google.com/accounts/answer/185833), not your regular password!
|
|
462
|
-
|
|
463
|
-
### Step 4: Enable in Admin Panel
|
|
464
|
-
|
|
465
|
-
1. Go to **Sessions β Settings**
|
|
466
|
-
2. Scroll to **"Email Notifications"**
|
|
467
|
-
3. Toggle **"Enable Email Alerts"** to ON
|
|
468
|
-
4. Customize email templates (optional)
|
|
469
|
-
5. Click **Save**
|
|
470
|
-
|
|
471
|
-
### Step 5: Test It
|
|
472
|
-
|
|
473
|
-
Trigger a suspicious login (e.g., use a VPN) and check if the email arrives!
|
|
474
|
-
|
|
475
|
-
**Troubleshooting:**
|
|
476
|
-
- Check Strapi logs for email errors
|
|
477
|
-
- Verify SMTP credentials are correct
|
|
478
|
-
- Test SMTP connection with a tool like [smtp-tester](https://www.npmjs.com/package/smtp-tester)
|
|
479
|
-
|
|
480
399
|
---
|
|
481
400
|
|
|
482
|
-
##
|
|
401
|
+
## Content API
|
|
483
402
|
|
|
484
|
-
|
|
485
|
-
Users can only access their **own** sessions.
|
|
403
|
+
Prefix `/api/magic-sessionmanager`. Every route requires a Users & Permissions JWT (`Authorization: Bearer <JWT>`), works on the caller's **own** sessions only and is rate-limited (writes 10, reads 120 requests per minute by default; 429 with `Retry-After`).
|
|
486
404
|
|
|
487
|
-
|
|
405
|
+
| Method | Path | Purpose | Response |
|
|
406
|
+
| ------ | ------------------------- | ----------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ |
|
|
407
|
+
| GET | `/my-sessions` | Own sessions (up to 200), current session first | `{ data: [...], meta: { count, active, hasMore, limit } }` |
|
|
408
|
+
| GET | `/current-session` | The session of the current token | `{ data: {..., isCurrentSession: true } }`; 404 when none |
|
|
409
|
+
| GET | `/user/:userId/sessions` | Sessions of a user; only your own `userId` | 403 for another user |
|
|
410
|
+
| POST | `/logout` | End the current session (reason `logout`) | `{ message, terminated }` |
|
|
411
|
+
| POST | `/logout-all` | End all own sessions (reason `logout`) | `{ message, terminatedCount }` |
|
|
412
|
+
| POST | `/logout-others` | End all own sessions except the current one | `{ message, terminatedCount, currentSessionPreserved }` |
|
|
413
|
+
| DELETE | `/my-sessions/:sessionId` | End one own session that is not the current one (reason `manual`) | `{ message, success, alreadyTerminated }`; 400 for the current session, 404 for unknown or foreign IDs |
|
|
488
414
|
|
|
489
|
-
|
|
415
|
+
`POST /api/auth/logout` also ends the current session; the plugin mounts it when Users & Permissions does not provide it.
|
|
490
416
|
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
```
|
|
417
|
+
Session objects contain `id`, `documentId`, `sessionId`, `ipAddress`, `userAgent`, `loginTime`, `lastActive`, `logoutTime`, `isActive`, `terminationReason`, `deviceType`, `browserName`, `osName`, `geoLocation`, `securityScore`, `isTrulyActive` (Active rather than Idle), `minutesSinceActive` and `isCurrentSession`. Tokens and token hashes are never returned. Use `id` / `documentId` (or the `native_` ID of a native-only row) for `DELETE /my-sessions/:sessionId`.
|
|
418
|
+
|
|
419
|
+
Example:
|
|
495
420
|
|
|
496
|
-
**Response:**
|
|
497
421
|
```json
|
|
498
422
|
{
|
|
499
423
|
"data": [
|
|
500
424
|
{
|
|
501
|
-
"id": "
|
|
502
|
-
"documentId": "
|
|
425
|
+
"id": "k2v8m1x0q9w7e5r3t1y6u4i2",
|
|
426
|
+
"documentId": "k2v8m1x0q9w7e5r3t1y6u4i2",
|
|
503
427
|
"sessionId": "sess_m5k2h_8a3b1c2d_f9e8d7c6",
|
|
504
|
-
"ipAddress": "
|
|
505
|
-
"
|
|
506
|
-
"
|
|
507
|
-
"lastActive": "2026-01-02T13:45:00.000Z",
|
|
428
|
+
"ipAddress": "203.0.113.24",
|
|
429
|
+
"loginTime": "2026-11-06T10:30:00.000Z",
|
|
430
|
+
"lastActive": "2026-11-06T13:45:00.000Z",
|
|
508
431
|
"logoutTime": null,
|
|
509
432
|
"isActive": true,
|
|
510
433
|
"deviceType": "desktop",
|
|
511
|
-
"browserName": "Chrome
|
|
512
|
-
"osName": "macOS
|
|
513
|
-
"geoLocation": null,
|
|
514
|
-
"securityScore": null,
|
|
515
|
-
"isCurrentSession": true,
|
|
434
|
+
"browserName": "Chrome",
|
|
435
|
+
"osName": "macOS",
|
|
516
436
|
"isTrulyActive": true,
|
|
517
|
-
"minutesSinceActive": 2
|
|
518
|
-
|
|
519
|
-
{
|
|
520
|
-
"id": "def456uvw",
|
|
521
|
-
"documentId": "def456uvw",
|
|
522
|
-
"sessionId": "sess_m5k1g_7b2a0c1d_e8d7c6b5",
|
|
523
|
-
"ipAddress": "10.0.0.50",
|
|
524
|
-
"userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 17_0 like Mac OS X)...",
|
|
525
|
-
"loginTime": "2026-01-01T08:15:00.000Z",
|
|
526
|
-
"lastActive": "2026-01-01T12:00:00.000Z",
|
|
527
|
-
"logoutTime": null,
|
|
528
|
-
"isActive": true,
|
|
529
|
-
"deviceType": "mobile",
|
|
530
|
-
"browserName": "Safari",
|
|
531
|
-
"osName": "iOS 17",
|
|
532
|
-
"geoLocation": null,
|
|
533
|
-
"securityScore": null,
|
|
534
|
-
"isCurrentSession": false,
|
|
535
|
-
"isTrulyActive": false,
|
|
536
|
-
"minutesSinceActive": 1545
|
|
437
|
+
"minutesSinceActive": 2,
|
|
438
|
+
"isCurrentSession": true
|
|
537
439
|
}
|
|
538
440
|
],
|
|
539
|
-
"meta": {
|
|
540
|
-
"count": 2,
|
|
541
|
-
"active": 1
|
|
542
|
-
}
|
|
543
|
-
}
|
|
544
|
-
```
|
|
545
|
-
|
|
546
|
-
### Get Current Session
|
|
547
|
-
|
|
548
|
-
Returns only the session associated with the current JWT token.
|
|
549
|
-
|
|
550
|
-
```bash
|
|
551
|
-
GET /api/magic-sessionmanager/current-session
|
|
552
|
-
Authorization: Bearer <JWT>
|
|
553
|
-
```
|
|
554
|
-
|
|
555
|
-
**Response:**
|
|
556
|
-
```json
|
|
557
|
-
{
|
|
558
|
-
"data": {
|
|
559
|
-
"id": "abc123xyz",
|
|
560
|
-
"documentId": "abc123xyz",
|
|
561
|
-
"sessionId": "sess_m5k2h_8a3b1c2d_f9e8d7c6",
|
|
562
|
-
"ipAddress": "192.168.1.100",
|
|
563
|
-
"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36...",
|
|
564
|
-
"loginTime": "2026-01-02T10:30:00.000Z",
|
|
565
|
-
"lastActive": "2026-01-02T13:45:00.000Z",
|
|
566
|
-
"logoutTime": null,
|
|
567
|
-
"isActive": true,
|
|
568
|
-
"deviceType": "desktop",
|
|
569
|
-
"browserName": "Chrome 143",
|
|
570
|
-
"osName": "macOS 10.15.7",
|
|
571
|
-
"geoLocation": null,
|
|
572
|
-
"securityScore": null,
|
|
573
|
-
"isCurrentSession": true,
|
|
574
|
-
"isTrulyActive": true,
|
|
575
|
-
"minutesSinceActive": 2
|
|
576
|
-
}
|
|
577
|
-
}
|
|
578
|
-
```
|
|
579
|
-
|
|
580
|
-
### Logout (Current Session)
|
|
581
|
-
|
|
582
|
-
Terminates only the current session.
|
|
583
|
-
|
|
584
|
-
```bash
|
|
585
|
-
POST /api/magic-sessionmanager/logout
|
|
586
|
-
Authorization: Bearer <JWT>
|
|
587
|
-
```
|
|
588
|
-
|
|
589
|
-
**Response:**
|
|
590
|
-
```json
|
|
591
|
-
{
|
|
592
|
-
"message": "Logged out successfully"
|
|
593
|
-
}
|
|
594
|
-
```
|
|
595
|
-
|
|
596
|
-
### Logout All Devices
|
|
597
|
-
|
|
598
|
-
Terminates ALL sessions for the authenticated user (logs out everywhere).
|
|
599
|
-
|
|
600
|
-
```bash
|
|
601
|
-
POST /api/magic-sessionmanager/logout-all
|
|
602
|
-
Authorization: Bearer <JWT>
|
|
603
|
-
```
|
|
604
|
-
|
|
605
|
-
**Response:**
|
|
606
|
-
```json
|
|
607
|
-
{
|
|
608
|
-
"message": "Logged out from all devices successfully"
|
|
609
|
-
}
|
|
610
|
-
```
|
|
611
|
-
|
|
612
|
-
### Terminate Specific Session
|
|
613
|
-
|
|
614
|
-
Terminates a specific session (not the current one). Useful for "Log out other devices".
|
|
615
|
-
Use the `id` / `documentId` value from the session response. The separate `sessionId` field is a tracking identifier stored on the session record.
|
|
616
|
-
|
|
617
|
-
```bash
|
|
618
|
-
DELETE /api/magic-sessionmanager/my-sessions/:documentId
|
|
619
|
-
Authorization: Bearer <JWT>
|
|
620
|
-
```
|
|
621
|
-
|
|
622
|
-
**Response:**
|
|
623
|
-
```json
|
|
624
|
-
{
|
|
625
|
-
"message": "Session abc123xyz terminated successfully",
|
|
626
|
-
"success": true
|
|
627
|
-
}
|
|
628
|
-
```
|
|
629
|
-
|
|
630
|
-
**Error (trying to terminate current session):**
|
|
631
|
-
```json
|
|
632
|
-
{
|
|
633
|
-
"error": {
|
|
634
|
-
"status": 400,
|
|
635
|
-
"message": "Cannot terminate current session. Use /logout instead."
|
|
636
|
-
}
|
|
441
|
+
"meta": { "count": 1, "active": 1, "hasMore": false, "limit": 200 }
|
|
637
442
|
}
|
|
638
443
|
```
|
|
639
444
|
|
|
640
445
|
---
|
|
641
446
|
|
|
642
|
-
##
|
|
643
|
-
|
|
644
|
-
These endpoints require admin authentication.
|
|
645
|
-
|
|
646
|
-
### Get All Sessions
|
|
647
|
-
|
|
648
|
-
```bash
|
|
649
|
-
GET /magic-sessionmanager/sessions
|
|
650
|
-
```
|
|
651
|
-
|
|
652
|
-
### Get Active Sessions Only
|
|
653
|
-
|
|
654
|
-
```bash
|
|
655
|
-
GET /magic-sessionmanager/sessions/active
|
|
656
|
-
```
|
|
657
|
-
|
|
658
|
-
### Force Terminate Session
|
|
659
|
-
|
|
660
|
-
```bash
|
|
661
|
-
POST /magic-sessionmanager/sessions/:sessionId/terminate
|
|
662
|
-
```
|
|
663
|
-
|
|
664
|
-
### Terminate All User Sessions
|
|
665
|
-
|
|
666
|
-
```bash
|
|
667
|
-
POST /magic-sessionmanager/user/:userId/terminate-all
|
|
668
|
-
```
|
|
669
|
-
|
|
670
|
-
### Block/Unblock User
|
|
671
|
-
|
|
672
|
-
```bash
|
|
673
|
-
POST /magic-sessionmanager/user/:userId/toggle-block
|
|
674
|
-
```
|
|
675
|
-
|
|
676
|
-
### Clean Inactive Sessions
|
|
677
|
-
|
|
678
|
-
```bash
|
|
679
|
-
POST /magic-sessionmanager/sessions/clean-inactive
|
|
680
|
-
```
|
|
447
|
+
## Optional route policy: `session-required`
|
|
681
448
|
|
|
682
|
-
|
|
449
|
+
You do **not** need this policy for session revocation. The plugin wraps the Users & Permissions JWT check for every Content API request, so an ended, expired or revoked session is rejected on all routes without configuration. No plugin route attaches the policy.
|
|
683
450
|
|
|
684
|
-
|
|
451
|
+
The policy is opt-in for an explicit, per-route check on your **own** routes. It follows the same Token check setting as the global check, so it cannot make a single route stricter than the rest.
|
|
685
452
|
|
|
686
|
-
|
|
453
|
+
```js
|
|
454
|
+
// src/api/order/routes/order.js
|
|
455
|
+
const { factories } = require('@strapi/strapi');
|
|
687
456
|
|
|
688
|
-
|
|
689
|
-
'magic-sessionmanager': {
|
|
457
|
+
module.exports = factories.createCoreRouter('api::order.order', {
|
|
690
458
|
config: {
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
// When to mark sessions inactive (in milliseconds)
|
|
695
|
-
inactivityTimeout: 900000, // Default: 15 minutes
|
|
459
|
+
find: { policies: ['plugin::magic-sessionmanager.session-required'] },
|
|
460
|
+
findOne: { policies: ['plugin::magic-sessionmanager.session-required'] },
|
|
696
461
|
},
|
|
697
|
-
}
|
|
462
|
+
});
|
|
698
463
|
```
|
|
699
464
|
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
465
|
+
| Case | Strict token check | Relaxed token check |
|
|
466
|
+
| ------------------------------------------------------------------- | ------------------------------------- | ---------------------------------- |
|
|
467
|
+
| No authenticated user on the request (public route, API token) | allowed; the route's own auth decides | allowed |
|
|
468
|
+
| User cannot be resolved to a `documentId` | 401 | allowed |
|
|
469
|
+
| No `Authorization: Bearer` token | 401 | allowed |
|
|
470
|
+
| `jwtManagement: 'refresh'` and Strapi verified no native session id | 401 | allowed |
|
|
471
|
+
| A matching session row is open | allowed | allowed |
|
|
472
|
+
| The matching session row is ended | 401 "Session terminated" | 401 "Session terminated" |
|
|
473
|
+
| No session row matches | 401 | allowed, with a warning in the log |
|
|
474
|
+
| Settings or the session lookup fail | 401 | allowed |
|
|
706
475
|
|
|
707
476
|
---
|
|
708
477
|
|
|
709
|
-
##
|
|
710
|
-
|
|
711
|
-
|
|
478
|
+
## Admin API and permissions
|
|
479
|
+
|
|
480
|
+
Prefix `/magic-sessionmanager` (Strapi admin API). Every route requires an authenticated Strapi admin **and** the permission `plugin::magic-sessionmanager.access` ("Access the Session Manager plugin"). The same permission controls the menu link, the settings links, the widget and the user panel. Admin responses never contain tokens or the internal `sessionId`.
|
|
481
|
+
|
|
482
|
+
| Method | Path | Admin UI action |
|
|
483
|
+
| -------- | -------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- |
|
|
484
|
+
| GET | `/sessions` | Sessions dashboard, widget, Analytics (latest 1,000; `meta.truncated` when more exist) |
|
|
485
|
+
| GET | `/sessions/active` | Open sessions only |
|
|
486
|
+
| GET | `/user/:userId/sessions` | Sessions panel |
|
|
487
|
+
| POST | `/sessions/:sessionId/terminate` | **End session** (reason `manual`; in refresh mode the Strapi session is revoked first; the record stays) |
|
|
488
|
+
| DELETE | `/sessions/:sessionId` | **Delete record** (record removed, token stays revoked; an open session also ends) |
|
|
489
|
+
| POST | `/sessions/clean-inactive` | **Delete ended sessions** (all users; open and idle sessions are not affected; does not run the idle check) |
|
|
490
|
+
| POST | `/user/:userId/terminate-all` | **End all sessions** (reason `manual`) |
|
|
491
|
+
| POST | `/user/:userId/toggle-block` | **Block user** / **Unblock user** |
|
|
492
|
+
| GET | `/users/stats` | Widget totals (`totalUsers`, `blockedUsers`) |
|
|
493
|
+
| GET | `/geolocation/:ipAddress` | **Look up location** |
|
|
494
|
+
| GET | `/geoip/status` | GeoIP database status |
|
|
495
|
+
| PUT | `/geoip/credentials` | Save or remove (`{ "clear": true }`) MaxMind credentials |
|
|
496
|
+
| POST | `/geoip/update` | Update database / Force download |
|
|
497
|
+
| GET, PUT | `/settings` | Configuration (PUT validates every field and returns `error.details.errors` on invalid input) |
|
|
498
|
+
| GET | `/license/status` | License page |
|
|
499
|
+
| POST | `/license/auto-create`, `/license/create`, `/license/ping`, `/license/store-key` | License service routes (no admin UI) |
|
|
500
|
+
| POST | `/sessions/:sessionId/simulate-timeout` | Development only; removed when `NODE_ENV` is `production` or `staging` |
|
|
501
|
+
|
|
502
|
+
**Block / unblock** (`toggle-block`): send `{ "blocked": true }` or `{ "blocked": false }`. This sets the state, is safe to retry and is what the admin UI sends. A request without a body still toggles, but is deprecated, because a retry after a lost response can reverse the intended state. A non-boolean `blocked` returns 400. The response contains `blocked` and `mode` (`explicit` or `toggle`). Blocking ends all open sessions with the reason `blocked`; if that fails, the response is 500 and the request can be retried.
|
|
503
|
+
|
|
504
|
+
Errors use Strapi's `{ data: null, error }` envelope: 400 for invalid input, 404 for unknown IDs, 500 for server-side failures (502 for a failed MaxMind download, 503 when the license server is unreachable).
|
|
712
505
|
|
|
713
|
-
|
|
714
|
-
1. Make sure plugin is in `config/plugins.ts`
|
|
715
|
-
2. Run `npm run build`
|
|
716
|
-
3. Restart Strapi
|
|
717
|
-
4. Refresh browser (Cmd+Shift+R)
|
|
718
|
-
|
|
719
|
-
### Sessions not being created
|
|
720
|
-
|
|
721
|
-
**Fix:**
|
|
722
|
-
1. Check Strapi logs for errors
|
|
723
|
-
2. Make sure users are logging in (not already logged in)
|
|
724
|
-
3. Check database is working
|
|
506
|
+
---
|
|
725
507
|
|
|
726
|
-
|
|
508
|
+
## Security and privacy
|
|
727
509
|
|
|
728
|
-
**
|
|
729
|
-
- 401 = Not logged in (need to login as admin)
|
|
730
|
-
- 403 = Not allowed (check you're admin, not regular user)
|
|
510
|
+
- **Encryption key.** Stored tokens are encrypted with AES-256-GCM using `SESSION_ENCRYPTION_KEY`. In production, startup fails without it. Outside production a derived development key is used with a warning. Changing the key makes existing encrypted tokens unreadable, so keep it stable. Generate one in **Configuration βΊ Sessions βΊ Advanced** ("Copy for .env" copies `SESSION_ENCRYPTION_KEY="β¦"`; nothing is saved in Strapi) or with:
|
|
731
511
|
|
|
732
|
-
|
|
512
|
+
```bash
|
|
513
|
+
node -e "console.log(require('crypto').randomBytes(32).toString('base64'))"
|
|
514
|
+
```
|
|
733
515
|
|
|
734
|
-
**
|
|
735
|
-
-
|
|
736
|
-
-
|
|
737
|
-
-
|
|
516
|
+
- **Ownership.** Content API routes only return or end the caller's own sessions. A foreign session ID answers exactly like a missing one, so IDs cannot be probed.
|
|
517
|
+
- **Revocation.** Ended, expired and revoked sessions and blocked users are rejected on every Content API request, in both token check modes. Tokens of deleted records stay on a revocation list.
|
|
518
|
+
- **Password reset.** A successful password reset ends every older session of the user in both JWT modes.
|
|
519
|
+
- **Privacy.** Session records contain IP addresses, user agents and location data. With the `auto` or `ipapi` provider, IP addresses can be sent to ipapi.co; use `local-mmdb` or turn off IP location lookup to avoid that. The details dialog never looks up a location unless you click **Look up location**. Set **Keep ended sessions for** to match your retention policy, and use **Delete ended sessions** or **Delete record** to remove history.
|
|
520
|
+
- **Secrets.** MaxMind license keys are never returned to the browser. Webhook URLs grant posting rights to your channel; treat them as secrets. Exports never contain tokens.
|
|
521
|
+
- **Admin sessions** of Strapi administrators are out of scope.
|
|
738
522
|
|
|
739
523
|
---
|
|
740
524
|
|
|
741
|
-
##
|
|
525
|
+
## Troubleshooting
|
|
742
526
|
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
-
|
|
746
|
-
-
|
|
747
|
-
|
|
748
|
-
-
|
|
527
|
+
| Problem | Fix |
|
|
528
|
+
| --------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
529
|
+
| No Session Manager menu item | Check `config/plugins.ts`, run `npm run build`, restart, hard-refresh the browser. For non-Super-Admin roles, grant "Access the Session Manager plugin". |
|
|
530
|
+
| No sessions appear | Only end-user sign-ins through Users & Permissions are recorded, not Strapi admin sign-ins. Check the Strapi log. |
|
|
531
|
+
| Startup fails with `SESSION_ENCRYPTION_KEY is required in production` | Set the variable and restart. |
|
|
532
|
+
| 401 on every request after a sign-in | Check the `X-Session-Terminated-Reason` header. With Strict token check, tokens without a session record are rejected. |
|
|
533
|
+
| 429 on sign-in | Temporary IP lockout. Wait 15 minutes or raise `maxFailedLogins`. Behind a proxy, turn on Trust proxy headers so the lockout targets the real client. |
|
|
534
|
+
| Location is always "β" | IP location lookup is off, the provider is `disabled`, or `local-mmdb` has no database. See Configuration βΊ Location data. |
|
|
535
|
+
| Numbers differ from 4.x | The widget and Analytics now count Active and Idle by the configured inactivity timeout; "Online now" is now "Active sessions". |
|
|
749
536
|
|
|
750
|
-
|
|
751
|
-
- Single-user app
|
|
752
|
-
- No need to see who's logged in
|
|
753
|
-
- No security requirements
|
|
537
|
+
The plugin stores sessions in the `magic_sessions` table and revocations in its own revoked-token table.
|
|
754
538
|
|
|
755
539
|
---
|
|
756
540
|
|
|
757
|
-
##
|
|
758
|
-
|
|
759
|
-
### Quick Manual Test
|
|
541
|
+
## Development and tests
|
|
760
542
|
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
**1. Login:**
|
|
770
|
-
```
|
|
771
|
-
POST http://localhost:1337/api/auth/local
|
|
772
|
-
Body: { "identifier": "user@test.com", "password": "pass123" }
|
|
543
|
+
```bash
|
|
544
|
+
npm ci --legacy-peer-deps
|
|
545
|
+
npm test # node --test tests/*.test.js tests/*.test.mjs
|
|
546
|
+
npm run test:ts:front
|
|
547
|
+
npm run test:ts:back
|
|
548
|
+
npm run build
|
|
549
|
+
npm run verify
|
|
550
|
+
npm run verify:runtime
|
|
773
551
|
```
|
|
774
552
|
|
|
775
|
-
|
|
776
|
-
```
|
|
777
|
-
GET http://localhost:1337/magic-sessionmanager/sessions
|
|
778
|
-
```
|
|
553
|
+
HTTP integration tests need Strapi host dependencies: set `SESSION_HTTP_STRAPI_NODE_MODULES` to the `node_modules` of a Strapi 5 host; without it they skip with a message.
|
|
779
554
|
|
|
780
|
-
**
|
|
781
|
-
```
|
|
782
|
-
POST http://localhost:1337/api/auth/logout
|
|
783
|
-
Authorization: Bearer YOUR_JWT_TOKEN
|
|
784
|
-
```
|
|
555
|
+
Quick manual check: sign in to your app as an end user (`POST /api/auth/local`), open Session Manager and find the session as **Active**, click **End session** and confirm, then call any Content API route with the same token: it returns 401 and the row shows **Ended Β· Ended manually**.
|
|
785
556
|
|
|
786
|
-
|
|
557
|
+
Releases use Conventional Commits and semantic-release on Node.js 22 with npm Trusted Publishing (GitHub OIDC).
|
|
787
558
|
|
|
788
559
|
---
|
|
789
560
|
|
|
790
|
-
##
|
|
561
|
+
## Maintenance status
|
|
791
562
|
|
|
792
|
-
|
|
563
|
+
As of 2026-11-06:
|
|
793
564
|
|
|
794
|
-
-
|
|
795
|
-
-
|
|
796
|
-
-
|
|
797
|
-
-
|
|
798
|
-
- β
Encryption (secure)
|
|
799
|
-
- β
Multi-device support
|
|
565
|
+
- **4.8.0 is not accepted.** It was released before its acceptance gates closed. Known defects in 4.8.0, fixed on the redesign branch: the Session details dialog had no accessible name; Settings field hints, including the GeoIP privacy note, did not render; three Settings alerts had unnamed close buttons and country chips could not be removed with the keyboard; in `legacy-support` mode a password reset left older sessions usable; a failed block followed by a retry of the bodyless toggle unblocked the user; the Content API rate limiter could be bypassed by varying the path. See [CHANGELOG.md](CHANGELOG.md).
|
|
566
|
+
- **Accepted on the redesign branch:** clean install, 749 of 749 tests, both type checks, build, `verify` and `verify:runtime`, `npm pack --dry-run`; desktop and mobile browser passes for every screen on an isolated Strapi 5.61.0 host with synthetic data; the strict source symmetry contract (no `window.confirm`, emoji, colour literals, px font sizes or custom media queries).
|
|
567
|
+
- **Still open before the next release:** full keyboard and screen-reader walks in five locales, dark-mode contrast, the complete state matrix, measured layout symmetry at every breakpoint, a fresh-database host boot, and a consent decision for the `auto` provider's ipapi.co default.
|
|
568
|
+
- **Dependency advisories:** the recorded high-severity findings come through the Strapi 5 core dependency chain (`braces` GHSA-vfj7-8cjw-p6xm, Zod GHSA-mrhx-c7xc-m3w5 via `@strapi/utils` 5.61.0). No compatible fix exists; the forced npm fix downgrades to Strapi 4, so none was applied.
|
|
800
569
|
|
|
801
|
-
|
|
802
|
-
- β
IP Geolocation
|
|
803
|
-
- β
Threat detection
|
|
804
|
-
- β
Auto-blocking
|
|
805
|
-
- β
Email/webhook alerts
|
|
570
|
+
Report bugs at https://github.com/Schero94/Magic-Sessionmanager/issues.
|
|
806
571
|
|
|
807
572
|
---
|
|
808
573
|
|
|
809
|
-
##
|
|
810
|
-
|
|
811
|
-
**Q: Do I need to change my Strapi code?**
|
|
812
|
-
A: No! Just install and enable the plugin.
|
|
574
|
+
## Languages
|
|
813
575
|
|
|
814
|
-
|
|
815
|
-
A: No! It just tracks them, doesn't change them.
|
|
816
|
-
|
|
817
|
-
**Q: Can users see each other's sessions?**
|
|
818
|
-
A: No! Only admins can see all sessions. Users only see their own.
|
|
819
|
-
|
|
820
|
-
**Q: What if I uninstall the plugin?**
|
|
821
|
-
A: Sessions will stop being tracked. Everything else works normally.
|
|
822
|
-
|
|
823
|
-
**Q: Does it slow down my app?**
|
|
824
|
-
A: No! It has smart rate-limiting to prevent database spam.
|
|
825
|
-
|
|
826
|
-
**Q: Can I customize the dashboard?**
|
|
827
|
-
A: Not yet, but it's planned for future versions!
|
|
576
|
+
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.
|
|
828
577
|
|
|
829
578
|
---
|
|
830
579
|
|
|
831
|
-
##
|
|
832
|
-
|
|
833
|
-
- **NPM:** https://www.npmjs.com/package/strapi-plugin-magic-sessionmanager
|
|
834
|
-
- **GitHub:** https://github.com/Schero94/Magic-Sessionmanager
|
|
835
|
-
- **Report Bugs:** https://github.com/Schero94/Magic-Sessionmanager/issues
|
|
836
|
-
|
|
837
|
-
---
|
|
580
|
+
## License
|
|
838
581
|
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
**MIT License** - Free to use for personal and commercial projects!
|
|
842
|
-
|
|
843
|
-
**Copyright Β© 2025 Schero D.**
|
|
844
|
-
|
|
845
|
-
### Optional license-key activation
|
|
846
|
-
|
|
847
|
-
The admin panel includes a License page where you can register an optional key. This is only used for install tracking and support context; it does not unlock or restrict any plugin feature.
|
|
848
|
-
|
|
849
|
-
See [LICENSE](./LICENSE) for full terms.
|
|
850
|
-
|
|
851
|
-
---
|
|
852
|
-
|
|
853
|
-
## π Supported Languages
|
|
854
|
-
|
|
855
|
-
The admin interface is available in **5 languages:**
|
|
856
|
-
|
|
857
|
-
- π¬π§ **English** - Default
|
|
858
|
-
- π©πͺ **Deutsch** - German
|
|
859
|
-
- πͺπΈ **EspaΓ±ol** - Spanish
|
|
860
|
-
- π«π· **FranΓ§ais** - French
|
|
861
|
-
- π΅πΉ **PortuguΓͺs** - Portuguese
|
|
862
|
-
|
|
863
|
-
Language automatically follows your Strapi admin interface setting.
|
|
864
|
-
|
|
865
|
-
---
|
|
582
|
+
MIT License. Copyright Β© 2025 Schero D. See [LICENSE](./LICENSE).
|
|
866
583
|
|
|
867
|
-
**
|
|
584
|
+
**License page.** Settings βΊ Session Manager βΊ License shows whether an optional license key is stored and valid. The key is used for install tracking and support context only; it does not unlock or restrict any feature.
|