strapi-plugin-magic-sessionmanager 4.10.0 → 4.11.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 (31) hide show
  1. package/CHANGELOG.md +44 -6
  2. package/README.md +251 -69
  3. package/dist/admin/{Analytics-CdmRsigN.js → Analytics-CBHeWeGn.js} +1 -1
  4. package/dist/admin/{Analytics-PRqsLMEx.mjs → Analytics-D56O8Q6e.mjs} +1 -1
  5. package/dist/admin/{App-DUMCbuCr.js → App-D4cBPwB_.js} +2 -3
  6. package/dist/admin/{App-BSeYF7KA.mjs → App-EDIkLJdb.mjs} +2 -3
  7. package/dist/admin/{OnlineUsersWidget-CDZ19_PT.js → OnlineUsersWidget-BF2R2YIy.js} +1 -1
  8. package/dist/admin/{OnlineUsersWidget-B5pXzqM9.mjs → OnlineUsersWidget-MwUutkKQ.mjs} +1 -1
  9. package/dist/admin/{Settings-CrLzRXrA.js → Settings-CMzEF8EH.js} +9 -3
  10. package/dist/admin/{Settings-B-GRuWjT.mjs → Settings-bLMyi0BN.mjs} +8 -2
  11. package/dist/admin/{de-DwUCBY1b.mjs → de-CxfuTF6C.mjs} +0 -42
  12. package/dist/admin/{de-Dzo1tVoJ.js → de-DVNTHmSo.js} +0 -42
  13. package/dist/admin/{en-Dd0wXfgR.mjs → en-BcPIlQYL.mjs} +0 -42
  14. package/dist/admin/{en-CL5llI55.js → en-BuVXIcHA.js} +0 -42
  15. package/dist/admin/{es-CiNDwv_f.js → es-CEteHmBO.js} +0 -42
  16. package/dist/admin/{es-Cl5IwDA4.mjs → es-DxHpaNA1.mjs} +0 -42
  17. package/dist/admin/{fr-DBOQ-UDm.js → fr-BMd2-wW7.js} +0 -42
  18. package/dist/admin/{fr-DhADj8Zs.mjs → fr-Dw43lHg7.mjs} +0 -42
  19. package/dist/admin/{index-CaLVyCio.js → index-DvNfekoR.js} +9 -19
  20. package/dist/admin/{index-CHACmZsg.mjs → index-qa6Qnfkc.mjs} +9 -19
  21. package/dist/admin/index.js +1 -1
  22. package/dist/admin/index.mjs +1 -1
  23. package/dist/admin/{pt-CT6VpDMM.mjs → pt-7jnxDSX-.mjs} +0 -42
  24. package/dist/admin/{pt-m73K1nJ0.js → pt-BvO63p01.js} +0 -42
  25. package/dist/server/index.js +26 -592
  26. package/dist/server/index.mjs +26 -592
  27. package/package.json +29 -13
  28. package/dist/admin/License-BeD7Du6r.js +0 -443
  29. package/dist/admin/License-D5W_l35e.mjs +0 -443
  30. package/dist/admin/maskSensitiveValue-BWcSjow7.js +0 -9
  31. package/dist/admin/maskSensitiveValue-lLRhN_S7.mjs +0 -10
package/package.json CHANGED
@@ -1,18 +1,22 @@
1
1
  {
2
- "version": "4.10.0",
2
+ "version": "4.11.0",
3
3
  "keywords": [
4
4
  "strapi",
5
- "plugin",
6
5
  "strapi-plugin",
7
6
  "strapi-v5",
7
+ "strapi-5",
8
8
  "sessions",
9
- "user-tracking",
10
- "login-logout",
11
- "activity-monitoring"
9
+ "session-management",
10
+ "jwt",
11
+ "refresh-token",
12
+ "logout",
13
+ "users-permissions",
14
+ "geoip",
15
+ "login-security"
12
16
  ],
13
17
  "type": "commonjs",
14
18
  "bin": {
15
- "strapi-magic-sessionmanager-geoip": "./scripts/update-geoip-db.mjs"
19
+ "strapi-magic-sessionmanager-geoip": "scripts/update-geoip-db.mjs"
16
20
  },
17
21
  "exports": {
18
22
  "./package.json": "./package.json",
@@ -64,6 +68,7 @@
64
68
  },
65
69
  "dependencies": {
66
70
  "@maxmind/geoip2-node": "^7.1.0",
71
+ "@strapi/utils": "^5.0.0",
67
72
  "sanitize-html": "^2.18.0"
68
73
  },
69
74
  "devDependencies": {
@@ -96,14 +101,25 @@
96
101
  "peerDependencies": {
97
102
  "@strapi/design-system": "^2.0.0",
98
103
  "@strapi/icons": "^2.0.0",
104
+ "@strapi/plugin-users-permissions": "^5.0.0",
99
105
  "@strapi/strapi": "^5.0.0",
100
- "@strapi/utils": "^5.0.0",
101
- "react": "^18.3.1",
102
- "react-dom": "^18.3.1",
106
+ "react": "^18.0.0",
107
+ "react-dom": "^18.0.0",
103
108
  "react-intl": "^6.0.0",
104
109
  "react-router-dom": "^6.0.0",
105
110
  "styled-components": "^6.0.0"
106
111
  },
112
+ "peerDependenciesMeta": {
113
+ "@strapi/design-system": {
114
+ "optional": true
115
+ },
116
+ "@strapi/icons": {
117
+ "optional": true
118
+ },
119
+ "react-intl": {
120
+ "optional": true
121
+ }
122
+ },
107
123
  "publishConfig": {
108
124
  "access": "public"
109
125
  },
@@ -111,19 +127,19 @@
111
127
  "kind": "plugin",
112
128
  "name": "magic-sessionmanager",
113
129
  "displayName": "Magic Sessionmanager",
114
- "description": "Advanced session management for Strapi v5 - Track user login/logout, session history, and online status"
130
+ "description": "Track, revoke and limit Users & Permissions login sessions, with online status, analytics and optional GeoIP checks."
115
131
  },
116
132
  "name": "strapi-plugin-magic-sessionmanager",
117
- "description": "Advanced Session Management for Strapi v5 - Track user sessions with IP geolocation, security scoring, and real-time monitoring",
133
+ "description": "Session tracking and control for Strapi 5 Users & Permissions logins: see who is online, revoke sessions, block users, rate-limit failed logins and add optional GeoIP checks.",
118
134
  "license": "MIT",
119
135
  "author": "Schero D.",
120
136
  "repository": {
121
137
  "type": "git",
122
- "url": "https://github.com/Schero94/Magic-Sessionmanager.git"
138
+ "url": "git+https://github.com/Schero94/Magic-Sessionmanager.git"
123
139
  },
124
140
  "bugs": {
125
141
  "url": "https://github.com/Schero94/Magic-Sessionmanager/issues"
126
142
  },
127
- "homepage": "https://github.com/Schero94/Magic-Sessionmanager#readme",
143
+ "homepage": "https://schero94.github.io/Magic-Sessionmanager/",
128
144
  "private": false
129
145
  }
@@ -1,443 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const jsxRuntime = require("react/jsx-runtime");
4
- const react = require("react");
5
- const reactIntl = require("react-intl");
6
- const designSystem = require("@strapi/design-system");
7
- const StrapiAdmin = require("@strapi/strapi/admin");
8
- const icons = require("@strapi/icons");
9
- const index = require("./index-CaLVyCio.js");
10
- const SectionCard = require("./SectionCard-BlWv8CRt.js");
11
- const maskSensitiveValue = require("./maskSensitiveValue-BWcSjow7.js");
12
- const LICENSE_STATE_MESSAGES = Object.freeze({
13
- noKey: Object.freeze({
14
- messageId: "license.state.noKey",
15
- defaultMessage: "No license key stored."
16
- }),
17
- valid: Object.freeze({
18
- messageId: "license.state.valid",
19
- defaultMessage: "License valid until {date}."
20
- }),
21
- validNoExpiry: Object.freeze({
22
- messageId: "license.state.validNoExpiry",
23
- defaultMessage: "License valid. It has no expiry date."
24
- }),
25
- expired: Object.freeze({
26
- messageId: "license.state.expired",
27
- defaultMessage: "License expired on {date}."
28
- }),
29
- expiredNoDate: Object.freeze({
30
- messageId: "license.state.expiredNoDate",
31
- defaultMessage: "License expired."
32
- }),
33
- invalid: Object.freeze({
34
- messageId: "license.state.invalid",
35
- defaultMessage: "This license key is not valid."
36
- }),
37
- unchecked: Object.freeze({
38
- messageId: "license.state.unchecked",
39
- defaultMessage: "The license status could not be checked."
40
- })
41
- });
42
- const LICENSE_FEATURES_MESSAGE = Object.freeze({
43
- messageId: "license.features.always",
44
- defaultMessage: "All features are available with or without a key."
45
- });
46
- const LICENSE_EXPIRY_DATE_OPTIONS = Object.freeze({ dateStyle: "medium" });
47
- const present = (value) => typeof value === "string" ? value.trim() !== "" : value !== null && value !== void 0;
48
- function getLicenseState(response, now = Date.now()) {
49
- const data = response?.data && typeof response.data === "object" ? response.data : {};
50
- const hasKey = typeof response?.hasKey === "boolean" ? response.hasKey : present(data.licenseKey);
51
- const expiresAt = present(data.expiresAt) ? data.expiresAt : null;
52
- const expiresAtMs = expiresAt ? Date.parse(expiresAt) : Number.NaN;
53
- const base = { hasKey, expiresAt, serverReachable: data.isOnline === true, data };
54
- if (!hasKey) return { ...base, state: "noKey" };
55
- const described = [
56
- "email",
57
- "firstName",
58
- "lastName",
59
- "expiresAt",
60
- "lastPingAt",
61
- "deviceName"
62
- ].some((field) => present(data[field]));
63
- if (!described) return { ...base, state: "unchecked" };
64
- const expired = data.isExpired === true || Number.isFinite(expiresAtMs) && expiresAtMs <= now;
65
- if (expired)
66
- return { ...base, state: Number.isFinite(expiresAtMs) ? "expired" : "expiredNoDate" };
67
- if (data.isActive === false) return { ...base, state: "invalid" };
68
- return { ...base, state: Number.isFinite(expiresAtMs) ? "valid" : "validNoExpiry" };
69
- }
70
- function describeLicenseState(licenseState, formatDate) {
71
- const descriptor = LICENSE_STATE_MESSAGES[licenseState?.state] || LICENSE_STATE_MESSAGES.unchecked;
72
- if (licenseState?.state === "valid" || licenseState?.state === "expired") {
73
- return {
74
- ...descriptor,
75
- values: { date: formatDate(licenseState.expiresAt, LICENSE_EXPIRY_DATE_OPTIONS) }
76
- };
77
- }
78
- return { ...descriptor };
79
- }
80
- const LICENSE_SUMMARY_MESSAGES = Object.freeze({
81
- heading: Object.freeze({
82
- messageId: "license.download.heading",
83
- defaultMessage: "Session Manager license"
84
- }),
85
- status: Object.freeze({ messageId: "license.download.status", defaultMessage: "Status" }),
86
- key: Object.freeze({ messageId: "license.key.title", defaultMessage: "License key" }),
87
- holder: Object.freeze({ messageId: "license.details.holder", defaultMessage: "Holder" }),
88
- email: Object.freeze({ messageId: "license.account.email", defaultMessage: "Email address" }),
89
- expires: Object.freeze({ messageId: "license.details.expires", defaultMessage: "Expires" }),
90
- noExpiry: Object.freeze({
91
- messageId: "license.details.noExpiry",
92
- defaultMessage: "No expiry date"
93
- }),
94
- deviceName: Object.freeze({
95
- messageId: "license.details.deviceName",
96
- defaultMessage: "Device name"
97
- }),
98
- ipAddress: Object.freeze({
99
- messageId: "license.details.ipAddress",
100
- defaultMessage: "IP address"
101
- }),
102
- lastCheck: Object.freeze({
103
- messageId: "license.details.lastCheck",
104
- defaultMessage: "Last check"
105
- }),
106
- deviceLimit: Object.freeze({
107
- messageId: "license.system.deviceLimit",
108
- defaultMessage: "Device limit"
109
- }),
110
- deviceLimitValue: Object.freeze({
111
- messageId: "license.system.deviceLimitValue",
112
- defaultMessage: "{current} of {max}"
113
- }),
114
- serverReachable: Object.freeze({
115
- messageId: "license.details.serverReachable",
116
- defaultMessage: "License server reachable"
117
- }),
118
- yes: Object.freeze({ messageId: "common.yes", defaultMessage: "Yes" }),
119
- no: Object.freeze({ messageId: "common.no", defaultMessage: "No" }),
120
- generated: Object.freeze({
121
- messageId: "license.download.generated",
122
- defaultMessage: "Generated"
123
- }),
124
- notProvided: Object.freeze({
125
- messageId: "license.value.notProvided",
126
- defaultMessage: "Not provided"
127
- })
128
- });
129
- const RULE = "========================================";
130
- const text = (value) => typeof value === "string" ? value.trim() : "";
131
- function getLicenseHolderName(data) {
132
- return [text(data?.firstName), text(data?.lastName)].filter(Boolean).join(" ");
133
- }
134
- function buildLicenseSummary({
135
- response,
136
- translate,
137
- formatDate,
138
- generatedAt = Date.now(),
139
- now = Date.now()
140
- }) {
141
- const m = LICENSE_SUMMARY_MESSAGES;
142
- const licenseState = getLicenseState(response, now);
143
- const data = licenseState.data;
144
- const statusMessage = describeLicenseState(licenseState, formatDate);
145
- const notProvided = translate(m.notProvided);
146
- const orMissing = (value) => text(value) || notProvided;
147
- const line = (descriptor, value) => `${translate(descriptor)}: ${value}`;
148
- return [
149
- translate(m.heading),
150
- RULE,
151
- line(m.status, translate(statusMessage, statusMessage.values)),
152
- translate(LICENSE_FEATURES_MESSAGE),
153
- "",
154
- line(m.key, orMissing(data.licenseKey)),
155
- line(m.holder, getLicenseHolderName(data) || notProvided),
156
- line(m.email, orMissing(data.email)),
157
- line(
158
- m.expires,
159
- licenseState.expiresAt ? formatDate(licenseState.expiresAt, LICENSE_EXPIRY_DATE_OPTIONS) : translate(m.noExpiry)
160
- ),
161
- line(m.deviceName, orMissing(data.deviceName)),
162
- line(m.ipAddress, orMissing(data.ipAddress)),
163
- line(m.lastCheck, data.lastPingAt ? formatDate(data.lastPingAt) : notProvided),
164
- line(
165
- m.deviceLimit,
166
- translate(m.deviceLimitValue, {
167
- current: Number(data.currentDevices) || 0,
168
- max: Number(data.maxDevices) || 1
169
- })
170
- ),
171
- line(m.serverReachable, translate(licenseState.serverReachable ? m.yes : m.no)),
172
- RULE,
173
- line(m.generated, formatDate(generatedAt)),
174
- ""
175
- ].join("\n");
176
- }
177
- const isForbidden = (error) => error?.status === 403 || error?.response?.status === 403;
178
- const LicensePage = () => {
179
- const { formatMessage } = reactIntl.useIntl();
180
- const { get } = StrapiAdmin.useFetchClient();
181
- const { toggleNotification } = StrapiAdmin.useNotification();
182
- const { copy } = StrapiAdmin.useClipboard();
183
- const { formatDate } = index.useSessionFormatters();
184
- const t = (id, defaultMessage, values) => formatMessage({ id: index.getTranslation(id), defaultMessage }, values);
185
- const translate = (descriptor, values) => formatMessage(
186
- { id: index.getTranslation(descriptor.messageId), defaultMessage: descriptor.defaultMessage },
187
- values
188
- );
189
- const [loading, setLoading] = react.useState(true);
190
- const [refreshing, setRefreshing] = react.useState(false);
191
- const [licenseData, setLicenseData] = react.useState(null);
192
- const [showLicenseKey, setShowLicenseKey] = react.useState(false);
193
- const [error, setError] = react.useState(false);
194
- const [forbidden, setForbidden] = react.useState(false);
195
- const requestPendingRef = react.useRef(false);
196
- const fetchLicenseStatus = react.useCallback(async () => {
197
- if (requestPendingRef.current) return false;
198
- requestPendingRef.current = true;
199
- try {
200
- const response = await get(`/${index.pluginId}/license/status`);
201
- setLicenseData(response.data);
202
- setError(false);
203
- return true;
204
- } catch (err) {
205
- index.logSafeAdminError("license.load", err);
206
- if (isForbidden(err)) setForbidden(true);
207
- setError(true);
208
- return false;
209
- } finally {
210
- requestPendingRef.current = false;
211
- setRefreshing(false);
212
- setLoading(false);
213
- }
214
- }, [get]);
215
- const checkLicenseStatus = async ({ announce }) => {
216
- if (requestPendingRef.current) return;
217
- setRefreshing(true);
218
- const loaded = await fetchLicenseStatus();
219
- if (loaded && announce) {
220
- toggleNotification({
221
- type: "success",
222
- message: t("license.success.refreshed", "License status checked.")
223
- });
224
- }
225
- };
226
- const handleRefresh = () => checkLicenseStatus({ announce: true });
227
- const handleCopyLicenseKey = async () => {
228
- try {
229
- const copied = await copy(licenseData?.data?.licenseKey || "");
230
- if (!copied) throw new Error("clipboard_unavailable");
231
- toggleNotification({
232
- type: "success",
233
- message: t("license.success.copied", "Copied.")
234
- });
235
- } catch (err) {
236
- index.logSafeAdminError("license.copyKey", err);
237
- toggleNotification({
238
- type: "danger",
239
- message: t("license.error.copy", "The key could not be copied.")
240
- });
241
- }
242
- };
243
- const handleDownloadLicenseKey = () => {
244
- try {
245
- const content = buildLicenseSummary({
246
- response: licenseData,
247
- translate,
248
- formatDate,
249
- generatedAt: Date.now()
250
- });
251
- const blob = new Blob([content], { type: "text/plain;charset=utf-8" });
252
- const url = window.URL.createObjectURL(blob);
253
- const link = document.createElement("a");
254
- link.href = url;
255
- link.download = "session-manager-license.txt";
256
- document.body.appendChild(link);
257
- link.click();
258
- document.body.removeChild(link);
259
- window.URL.revokeObjectURL(url);
260
- toggleNotification({
261
- type: "success",
262
- message: t("license.success.downloaded", "License details downloaded.")
263
- });
264
- } catch (err) {
265
- index.logSafeAdminError("license.download", err);
266
- toggleNotification({
267
- type: "danger",
268
- message: t("license.error.download", "The file could not be created.")
269
- });
270
- }
271
- };
272
- react.useEffect(() => {
273
- fetchLicenseStatus();
274
- }, [fetchLicenseStatus]);
275
- if (loading) {
276
- return /* @__PURE__ */ jsxRuntime.jsx(StrapiAdmin.Page.Loading, {});
277
- }
278
- if (forbidden) {
279
- return /* @__PURE__ */ jsxRuntime.jsx(StrapiAdmin.Page.NoPermissions, {});
280
- }
281
- const licenseState = licenseData ? getLicenseState(licenseData) : null;
282
- const hasKey = licenseState?.hasKey === true;
283
- const data = licenseState?.data || {};
284
- const statusMessage = licenseState ? describeLicenseState(licenseState, formatDate) : null;
285
- const yesNo = (value) => value ? t("common.yes", "Yes") : t("common.no", "No");
286
- const detailItems = [
287
- {
288
- id: "holder",
289
- label: t("license.details.holder", "Holder"),
290
- value: getLicenseHolderName(data)
291
- },
292
- {
293
- id: "email",
294
- kind: "email",
295
- label: t("license.account.email", "Email address"),
296
- value: data.email
297
- },
298
- {
299
- id: "expires",
300
- label: t("license.details.expires", "Expires"),
301
- value: licenseState?.expiresAt ? formatDate(licenseState.expiresAt, LICENSE_EXPIRY_DATE_OPTIONS) : t("license.details.noExpiry", "No expiry date")
302
- },
303
- {
304
- id: "device-name",
305
- label: t("license.details.deviceName", "Device name"),
306
- value: data.deviceName
307
- },
308
- {
309
- id: "ip",
310
- kind: "id",
311
- label: t("license.details.ipAddress", "IP address"),
312
- value: data.ipAddress
313
- },
314
- {
315
- id: "last-check",
316
- label: t("license.details.lastCheck", "Last check"),
317
- value: data.lastPingAt ? formatDate(data.lastPingAt) : null
318
- },
319
- {
320
- id: "device-limit",
321
- label: t("license.system.deviceLimit", "Device limit"),
322
- value: t("license.system.deviceLimitValue", "{current} of {max}", {
323
- current: Number(data.currentDevices) || 0,
324
- max: Number(data.maxDevices) || 1
325
- })
326
- },
327
- {
328
- id: "server-reachable",
329
- label: t("license.details.serverReachable", "License server reachable"),
330
- render: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Badge, { children: yesNo(licenseState?.serverReachable) })
331
- }
332
- ];
333
- return /* @__PURE__ */ jsxRuntime.jsxs(
334
- index.PageShell,
335
- {
336
- headingId: "magic-sessionmanager-license-title",
337
- title: t("license.title", "License"),
338
- subtitle: t("license.subtitle", "Optional license key for this installation."),
339
- primaryAction: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, wrap: "wrap", justifyContent: "flex-end", children: [
340
- hasKey ? /* @__PURE__ */ jsxRuntime.jsx(
341
- designSystem.Button,
342
- {
343
- variant: "secondary",
344
- startIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.Download, { "aria-hidden": true }),
345
- onClick: handleDownloadLicenseKey,
346
- children: t("license.key.download", "Download as text")
347
- }
348
- ) : null,
349
- /* @__PURE__ */ jsxRuntime.jsx(
350
- designSystem.Button,
351
- {
352
- variant: "secondary",
353
- startIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.ArrowClockwise, { "aria-hidden": true }),
354
- onClick: handleRefresh,
355
- "aria-busy": refreshing,
356
- children: t("license.refresh", "Check again")
357
- }
358
- )
359
- ] }),
360
- children: [
361
- /* @__PURE__ */ jsxRuntime.jsxs(SectionCard.SectionCard, { title: t("license.status.title", "License status"), children: [
362
- error ? /* @__PURE__ */ jsxRuntime.jsx(
363
- index.PersistentAlert,
364
- {
365
- variant: "danger",
366
- closeLabel: t("common.close", "Close"),
367
- action: /* @__PURE__ */ jsxRuntime.jsx(
368
- designSystem.Button,
369
- {
370
- variant: "secondary",
371
- onClick: () => checkLicenseStatus({ announce: false }),
372
- "aria-busy": refreshing,
373
- children: t("license.error.retry", "Try again")
374
- }
375
- ),
376
- children: /* @__PURE__ */ jsxRuntime.jsx(index.ReadableText, { variant: "omega", textColor: "neutral800", tag: "span", children: t("license.error.load", "The license status could not be checked.") })
377
- }
378
- ) : null,
379
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", alignItems: "stretch", gap: 1, "aria-live": "polite", children: [
380
- statusMessage ? /* @__PURE__ */ jsxRuntime.jsx(
381
- designSystem.Typography,
382
- {
383
- variant: "omega",
384
- tag: "p",
385
- textColor: "neutral800",
386
- fontWeight: "semiBold",
387
- "data-license-state": "",
388
- children: translate(statusMessage, statusMessage.values)
389
- }
390
- ) : null,
391
- /* @__PURE__ */ jsxRuntime.jsx(index.ReadableText, { variant: "omega", textColor: "neutral600", tag: "p", children: translate(LICENSE_FEATURES_MESSAGE) })
392
- ] })
393
- ] }),
394
- hasKey ? /* @__PURE__ */ jsxRuntime.jsx(SectionCard.SectionCard, { title: t("license.details.title", "License details"), children: /* @__PURE__ */ jsxRuntime.jsx(index.PropertyList, { items: detailItems }) }) : null,
395
- hasKey ? /* @__PURE__ */ jsxRuntime.jsx(SectionCard.SectionCard, { title: t("license.key.title", "License key"), children: /* @__PURE__ */ jsxRuntime.jsxs(
396
- designSystem.Field.Root,
397
- {
398
- name: "license-key",
399
- id: "magic-sessionmanager-license-key",
400
- hint: t("license.key.hint", "The key stays masked until you reveal it."),
401
- children: [
402
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: t("license.key.label", "Stored key") }),
403
- /* @__PURE__ */ jsxRuntime.jsx(
404
- designSystem.TextInput,
405
- {
406
- readOnly: true,
407
- autoComplete: "off",
408
- spellCheck: false,
409
- value: showLicenseKey ? data.licenseKey : maskSensitiveValue.maskSensitiveValue(data.licenseKey),
410
- endAction: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 1, children: [
411
- /* @__PURE__ */ jsxRuntime.jsx(
412
- designSystem.IconButton,
413
- {
414
- variant: "ghost",
415
- label: t(
416
- showLicenseKey ? "license.key.hide" : "license.key.show",
417
- showLicenseKey ? "Hide key" : "Show key"
418
- ),
419
- onClick: () => setShowLicenseKey((visible) => !visible),
420
- children: showLicenseKey ? /* @__PURE__ */ jsxRuntime.jsx(icons.EyeStriked, { "aria-hidden": true }) : /* @__PURE__ */ jsxRuntime.jsx(icons.Eye, { "aria-hidden": true })
421
- }
422
- ),
423
- /* @__PURE__ */ jsxRuntime.jsx(
424
- designSystem.IconButton,
425
- {
426
- variant: "ghost",
427
- label: t("license.key.copy", "Copy key"),
428
- onClick: handleCopyLicenseKey,
429
- children: /* @__PURE__ */ jsxRuntime.jsx(icons.Duplicate, { "aria-hidden": true })
430
- }
431
- )
432
- ] })
433
- }
434
- ),
435
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Hint, {})
436
- ]
437
- }
438
- ) }) : null
439
- ]
440
- }
441
- );
442
- };
443
- exports.default = LicensePage;