strapi-identity 0.4.2 → 0.5.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 (60) hide show
  1. package/dist/admin/{AdminReset-BiWQDTRv.js → AdminReset-BoWx0F06.js} +1 -1
  2. package/dist/admin/{AdminReset-DOmsyqwQ.mjs → AdminReset-D4NNnBDS.mjs} +1 -1
  3. package/dist/admin/{ProfileToggle-BUqs_hxZ.js → ProfileToggle-DtjyJRWN.js} +1 -1
  4. package/dist/admin/{ProfileToggle-k0d-caPC.mjs → ProfileToggle-NJZgrDT_.mjs} +1 -1
  5. package/dist/admin/{SettingsPage-DVVkN1xw.js → SettingsPage-BXl7gVGV.js} +1 -1
  6. package/dist/admin/{SettingsPage-Dm_llkYv.mjs → SettingsPage-CZuOMYvG.mjs} +1 -1
  7. package/dist/admin/{index-B9P8S4CX.js → index-BeqHh5Gz.js} +22 -15
  8. package/dist/admin/{index-DpIJdETG.mjs → index-CKG2ZxYT.mjs} +22 -15
  9. package/dist/admin/index.js +1 -1
  10. package/dist/admin/index.mjs +1 -1
  11. package/dist/admin/src/components/ConfirmModal/ConfirmModal.d.ts +9 -0
  12. package/dist/admin/src/components/ConfirmModal/index.d.ts +1 -0
  13. package/dist/admin/src/components/EmailOTPModal/EmailOTPModal.d.ts +8 -0
  14. package/dist/admin/src/components/Initializer.d.ts +5 -0
  15. package/dist/admin/src/components/InputOTP.d.ts +11 -0
  16. package/dist/admin/src/components/RemoveModal/RemoveModal.d.ts +6 -0
  17. package/dist/admin/src/components/RemoveModal/index.d.ts +1 -0
  18. package/dist/admin/src/components/WarningAlert/WarningAlert.d.ts +10 -0
  19. package/dist/admin/src/components/WarningAlert/index.d.ts +1 -0
  20. package/dist/admin/src/injection/AdminReset.d.ts +4 -0
  21. package/dist/admin/src/injection/ProfileToggle.d.ts +2 -0
  22. package/dist/admin/src/pages/EnforcedPage.d.ts +13 -0
  23. package/dist/admin/src/pluginId.d.ts +1 -0
  24. package/dist/admin/src/public/VerifyPage.d.ts +12 -0
  25. package/dist/admin/src/settings/SettingsPage.d.ts +1 -0
  26. package/dist/admin/src/utils/getTranslation.d.ts +2 -0
  27. package/dist/admin/src/utils/tokenHelpers.d.ts +12 -0
  28. package/dist/server/index.js +71 -47
  29. package/dist/server/index.mjs +71 -47
  30. package/dist/server/src/bootstrap.d.ts +3 -0
  31. package/dist/server/src/config/index.d.ts +3 -0
  32. package/dist/server/src/content-types/config/index.d.ts +72 -0
  33. package/dist/server/src/content-types/config/schema.json.d.ts +72 -0
  34. package/dist/server/src/content-types/email-otp/index.d.ts +48 -0
  35. package/dist/server/src/content-types/email-otp/schema.json.d.ts +48 -0
  36. package/dist/server/src/content-types/index.d.ts +3 -0
  37. package/dist/server/src/content-types/mfa/index.d.ts +55 -0
  38. package/dist/server/src/content-types/mfa/schema.json.d.ts +55 -0
  39. package/dist/server/src/content-types/temp-mfa/index.d.ts +35 -0
  40. package/dist/server/src/content-types/temp-mfa/schema.json.d.ts +35 -0
  41. package/dist/server/src/controllers/admin.d.ts +4 -0
  42. package/dist/server/src/controllers/config.d.ts +4 -0
  43. package/dist/server/src/controllers/controller.d.ts +8 -0
  44. package/dist/server/src/controllers/index.d.ts +3 -0
  45. package/dist/server/src/destroy.d.ts +3 -0
  46. package/dist/server/src/middlewares/index.d.ts +3 -0
  47. package/dist/server/src/policies/has-mfa.d.ts +3 -0
  48. package/dist/server/src/policies/index.d.ts +3 -0
  49. package/dist/server/src/register.d.ts +3 -0
  50. package/dist/server/src/routes/admin/admin.json.d.ts +35 -0
  51. package/dist/server/src/routes/admin/config.json.d.ts +50 -0
  52. package/dist/server/src/routes/admin/index.d.ts +3 -0
  53. package/dist/server/src/routes/admin/mfa.json.d.ts +94 -0
  54. package/dist/server/src/routes/index.d.ts +3 -0
  55. package/dist/server/src/services/admin.d.ts +11 -0
  56. package/dist/server/src/services/config.d.ts +57 -0
  57. package/dist/server/src/services/email.d.ts +8 -0
  58. package/dist/server/src/services/index.d.ts +3 -0
  59. package/dist/server/src/services/mfa.d.ts +82 -0
  60. package/package.json +6 -5
@@ -9643,7 +9643,7 @@ const replaceLogin = (route2, secret2, domain) => {
9643
9643
  await strapi.service("plugin::strapi-identity.email").send(adminUser.email, otp);
9644
9644
  }
9645
9645
  } catch (err) {
9646
- console.log("Error sending login email OTP:", err);
9646
+ strapi.log.error("Error sending login email OTP");
9647
9647
  }
9648
9648
  }
9649
9649
  ctx.res.removeHeader("set-cookie");
@@ -9657,7 +9657,7 @@ const replaceLogin = (route2, secret2, domain) => {
9657
9657
  const newToken = jwt.sign(newPayload, secret2, { expiresIn: "5m" });
9658
9658
  const expires = new Date(Date.now() + 5 * 60 * 1e3);
9659
9659
  const secure = strapi.config.get("admin.auth.cookie.secure") ?? process.env.NODE_ENV === "production";
9660
- const opt = { domain, httpOnly: false, overwrite: true, secure, expires };
9660
+ const opt = { domain, httpOnly: true, overwrite: true, secure, expires };
9661
9661
  ctx.cookies.set("strapi_admin_mfa", newToken, opt);
9662
9662
  ctx.body.data = { data: {}, error: null };
9663
9663
  });
@@ -9703,7 +9703,6 @@ const registerMiddlewares = (server) => {
9703
9703
  "/admin/users/me",
9704
9704
  "/strapi-identity/status",
9705
9705
  "/strapi-identity/config",
9706
- "/strapi-identity/config/enabled",
9707
9706
  "/strapi-identity/enable",
9708
9707
  "/strapi-identity/setup",
9709
9708
  "/strapi-identity/enable-email",
@@ -9711,7 +9710,6 @@ const registerMiddlewares = (server) => {
9711
9710
  ];
9712
9711
  const isAllowed = allowedPaths.includes(ctx.path) || // Static assets (JS, CSS, images, fonts, sourcemaps)
9713
9712
  /\.(mjs|js|css|png|jpg|jpeg|gif|svg|ico|woff2?|ttf|eot|map)(\?.*)?$/.test(ctx.path) || ctx.path.startsWith("/admin/@") || ctx.path.startsWith("/admin/src/");
9714
- if (!isAllowed) console.log(ctx.path);
9715
9713
  if (!isAllowed) {
9716
9714
  if (ctx.accepts("html") && ctx.path.startsWith("/admin")) {
9717
9715
  ctx.redirect("/admin/strapi-identity/enforced");
@@ -9838,7 +9836,7 @@ const config$2 = ({ strapi: strapi2 }) => ({
9838
9836
  ctx.status = 200;
9839
9837
  ctx.body = { data: enabled, error: null };
9840
9838
  } catch (error) {
9841
- console.log("Error checking if Strapi Identity is enabled:", error);
9839
+ strapi2.log.error("Error checking if Strapi Identity is enabled");
9842
9840
  ctx.status = 500;
9843
9841
  ctx.body = { data: null, error: "Server Error" };
9844
9842
  }
@@ -9849,18 +9847,7 @@ const config$2 = ({ strapi: strapi2 }) => ({
9849
9847
  ctx.status = 200;
9850
9848
  ctx.body = { data: config2, error: null };
9851
9849
  } catch (error) {
9852
- console.log("Error getting config:", error);
9853
- ctx.status = 500;
9854
- ctx.body = { data: null, error: "Server Error" };
9855
- }
9856
- },
9857
- async getEmailStatus(ctx) {
9858
- try {
9859
- const emailService = strapi2.config.get("plugin::email");
9860
- ctx.status = 200;
9861
- ctx.body = { data: emailService, error: null };
9862
- } catch (error) {
9863
- console.log("Error getting email status:", error);
9850
+ strapi2.log.error("Error getting config");
9864
9851
  ctx.status = 500;
9865
9852
  ctx.body = { data: null, error: "Server Error" };
9866
9853
  }
@@ -9872,7 +9859,7 @@ const config$2 = ({ strapi: strapi2 }) => ({
9872
9859
  ctx.status = 200;
9873
9860
  ctx.body = { data: updatedConfig, error: null };
9874
9861
  } catch (error) {
9875
- console.log("Error updating config:", error);
9862
+ strapi2.log.error("Error updating config");
9876
9863
  ctx.status = 500;
9877
9864
  ctx.body = { data: null, error: "Server Error" };
9878
9865
  }
@@ -9924,6 +9911,18 @@ const buildCookieOptionsWithExpiry = (type, absoluteExpiresAtISO, secureRequest)
9924
9911
  return { ...base, expires: chosen, maxAge: Math.max(0, chosen.getTime() - now) };
9925
9912
  };
9926
9913
  const controller = ({ strapi: strapi2 }) => ({
9914
+ async verifyInfo(ctx) {
9915
+ const secret2 = strapi2.config.get("admin.auth.secret");
9916
+ const token = ctx.cookies.get("strapi_admin_mfa");
9917
+ try {
9918
+ const payload = jwt.verify(token, secret2);
9919
+ ctx.status = 200;
9920
+ ctx.body = { data: { mfaType: payload.mfaType || null }, error: null };
9921
+ } catch {
9922
+ ctx.status = 401;
9923
+ ctx.body = { data: null, error: "Invalid or expired MFA session" };
9924
+ }
9925
+ },
9927
9926
  async verify(ctx) {
9928
9927
  const sessionManager = strapi2.sessionManager;
9929
9928
  const secret2 = strapi2.config.get("admin.auth.secret");
@@ -9970,7 +9969,7 @@ const controller = ({ strapi: strapi2 }) => ({
9970
9969
  error: null
9971
9970
  };
9972
9971
  } catch (error) {
9973
- console.log("Error verifying MFA code:", error);
9972
+ strapi2.log.error("Error verifying MFA code");
9974
9973
  ctx.status = 500;
9975
9974
  ctx.body = { data: null, error: "Server Error" };
9976
9975
  }
@@ -9993,7 +9992,7 @@ const controller = ({ strapi: strapi2 }) => ({
9993
9992
  ctx.body = { data: { message: "MFA disabled" }, error: null };
9994
9993
  }
9995
9994
  } catch (error) {
9996
- console.log("Error enabling/disabling MFA:", error);
9995
+ strapi2.log.error("Error enabling/disabling MFA");
9997
9996
  ctx.status = 500;
9998
9997
  ctx.body = { data: null, error: "Failed to update MFA" };
9999
9998
  }
@@ -10038,7 +10037,7 @@ const controller = ({ strapi: strapi2 }) => ({
10038
10037
  ctx.status = 200;
10039
10038
  ctx.body = { data: { message: "MFA disabled" }, error: null };
10040
10039
  } catch (error) {
10041
- console.log("Error disabling MFA:", error);
10040
+ strapi2.log.error("Error disabling MFA");
10042
10041
  ctx.status = 500;
10043
10042
  ctx.body = { data: null, error: "Failed to disable MFA" };
10044
10043
  }
@@ -10066,7 +10065,7 @@ const controller = ({ strapi: strapi2 }) => ({
10066
10065
  ctx.status = 200;
10067
10066
  ctx.body = { data: { message: "Verification email sent" }, error: null };
10068
10067
  } catch (error) {
10069
- console.log("Error initiating email MFA setup:", error);
10068
+ strapi2.log.error("Error initiating email MFA setup");
10070
10069
  ctx.status = 500;
10071
10070
  ctx.body = { data: null, error: "Failed to initiate email MFA setup" };
10072
10071
  }
@@ -10086,7 +10085,7 @@ const controller = ({ strapi: strapi2 }) => ({
10086
10085
  ctx.status = 200;
10087
10086
  ctx.body = { data: { message: "Email OTP enabled" }, error: null };
10088
10087
  } catch (error) {
10089
- console.log("Error completing email MFA setup:", error);
10088
+ strapi2.log.error("Error completing email MFA setup");
10090
10089
  ctx.status = 500;
10091
10090
  ctx.body = { data: null, error: "Failed to enable email MFA" };
10092
10091
  }
@@ -10107,7 +10106,7 @@ const controller = ({ strapi: strapi2 }) => ({
10107
10106
  ctx.status = 200;
10108
10107
  ctx.body = { data: { message: "Verification email sent" }, error: null };
10109
10108
  } catch (error) {
10110
- console.log("Error sending disable email OTP:", error);
10109
+ strapi2.log.error("Error sending disable email OTP");
10111
10110
  ctx.status = 500;
10112
10111
  ctx.body = { data: null, error: "Failed to send verification email" };
10113
10112
  }
@@ -10135,7 +10134,7 @@ const controller = ({ strapi: strapi2 }) => ({
10135
10134
  ctx.status = 200;
10136
10135
  ctx.body = { data: { message: "Verification email resent" }, error: null };
10137
10136
  } catch (error) {
10138
- console.log("Error resending login email OTP:", error);
10137
+ strapi2.log.error("Error resending login email OTP");
10139
10138
  ctx.status = 500;
10140
10139
  ctx.body = { data: null, error: "Failed to resend verification email" };
10141
10140
  }
@@ -10221,35 +10220,40 @@ const config$1 = [
10221
10220
  pluginName: "strapi-identity",
10222
10221
  type: "content-api"
10223
10222
  },
10224
- config: {}
10225
- },
10226
- {
10227
- method: "GET",
10228
- path: "/config",
10229
- handler: "config.getConfig",
10230
- info: {
10231
- apiName: "getConfig",
10232
- pluginName: "strapi-identity",
10233
- type: "content-api"
10234
- },
10235
10223
  config: {
10236
10224
  policies: [
10237
- "admin::isAuthenticatedAdmin"
10225
+ "admin::isAuthenticatedAdmin",
10226
+ {
10227
+ name: "admin::hasPermissions",
10228
+ config: {
10229
+ actions: [
10230
+ "plugin::strapi-identity.settings.read"
10231
+ ]
10232
+ }
10233
+ }
10238
10234
  ]
10239
10235
  }
10240
10236
  },
10241
10237
  {
10242
10238
  method: "GET",
10243
- path: "/config/email",
10244
- handler: "config.getEmailStatus",
10239
+ path: "/config",
10240
+ handler: "config.getConfig",
10245
10241
  info: {
10246
- apiName: "getEmailStatus",
10242
+ apiName: "getConfig",
10247
10243
  pluginName: "strapi-identity",
10248
10244
  type: "content-api"
10249
10245
  },
10250
10246
  config: {
10251
10247
  policies: [
10252
- "admin::isAuthenticatedAdmin"
10248
+ "admin::isAuthenticatedAdmin",
10249
+ {
10250
+ name: "admin::hasPermissions",
10251
+ config: {
10252
+ actions: [
10253
+ "plugin::strapi-identity.settings.read"
10254
+ ]
10255
+ }
10256
+ }
10253
10257
  ]
10254
10258
  }
10255
10259
  },
@@ -10278,6 +10282,22 @@ const config$1 = [
10278
10282
  }
10279
10283
  ];
10280
10284
  const mfa = [
10285
+ {
10286
+ method: "GET",
10287
+ path: "/verify/info",
10288
+ handler: "controller.verifyInfo",
10289
+ info: {
10290
+ apiName: "verifyInfo",
10291
+ pluginName: "strapi-identity",
10292
+ type: "content-api"
10293
+ },
10294
+ config: {
10295
+ auth: false,
10296
+ policies: [
10297
+ "has-mfa"
10298
+ ]
10299
+ }
10300
+ },
10281
10301
  {
10282
10302
  method: "POST",
10283
10303
  path: "/verify",
@@ -10291,6 +10311,9 @@ const mfa = [
10291
10311
  auth: false,
10292
10312
  policies: [
10293
10313
  "has-mfa"
10314
+ ],
10315
+ middlewares: [
10316
+ "admin::rateLimit"
10294
10317
  ]
10295
10318
  }
10296
10319
  },
@@ -10351,7 +10374,8 @@ const mfa = [
10351
10374
  auth: false,
10352
10375
  policies: [
10353
10376
  "has-mfa"
10354
- ]
10377
+ ],
10378
+ middlewares: []
10355
10379
  }
10356
10380
  },
10357
10381
  {
@@ -10400,7 +10424,7 @@ const isEnabled$1 = (id) => {
10400
10424
  try {
10401
10425
  return mfaToken2.count({ where: { admin_user: { id }, enabled: true } }).then((count) => count > 0);
10402
10426
  } catch (error) {
10403
- console.log("Error checking if 2FA is enabled for user:", error);
10427
+ strapi.log.error("Error checking if 2FA is enabled for user");
10404
10428
  return false;
10405
10429
  }
10406
10430
  };
@@ -10417,7 +10441,7 @@ const reset = async (id) => {
10417
10441
  existingTemp ? mfaTemp2.delete({ documentId: existingTemp.documentId }) : null
10418
10442
  ]);
10419
10443
  } catch (error) {
10420
- console.log("Error resetting 2FA for user:", error);
10444
+ strapi.log.error("Error resetting 2FA for user");
10421
10445
  throw new Error("Failed to reset 2FA for user");
10422
10446
  }
10423
10447
  };
@@ -10481,7 +10505,7 @@ const disableEmailMFAForAllUsers = async () => {
10481
10505
  )
10482
10506
  ]);
10483
10507
  } catch (err) {
10484
- console.log("Error disabling email MFA for all users:", err);
10508
+ strapi.log.error("Error disabling email MFA for all users");
10485
10509
  }
10486
10510
  };
10487
10511
  const disableMFAForAllUsers = async () => {
@@ -10497,7 +10521,7 @@ const disableMFAForAllUsers = async () => {
10497
10521
  ...temps.map((temp) => tempDocument.delete({ documentId: temp.documentId }))
10498
10522
  ]);
10499
10523
  } catch (err) {
10500
- console.log("Error disabling MFA for all users:", err);
10524
+ strapi.log.error("Error disabling MFA for all users");
10501
10525
  }
10502
10526
  };
10503
10527
  const checkUserByJWT = async (jwtToken) => {
@@ -10550,7 +10574,7 @@ const send = async (to, otp) => {
10550
10574
  sendConfig.replyTo = config2.response_email;
10551
10575
  }
10552
10576
  return emailService.send(sendConfig).catch((error) => {
10553
- console.log("Error sending email:", error);
10577
+ strapi.log.error("Error sending email");
10554
10578
  });
10555
10579
  };
10556
10580
  const replaceTemplateVariables = (template, variables) => {
@@ -0,0 +1,3 @@
1
+ import { Plugin } from '@strapi/types';
2
+ declare const bootstrap: Plugin.LoadedPlugin['bootstrap'];
3
+ export default bootstrap;
@@ -0,0 +1,3 @@
1
+ import { Plugin } from '@strapi/types';
2
+ declare const config: Plugin.LoadedPlugin['config'];
3
+ export default config;
@@ -0,0 +1,72 @@
1
+ declare const _default: {
2
+ schema: {
3
+ kind: string;
4
+ collectionName: string;
5
+ info: {
6
+ singularName: string;
7
+ pluralName: string;
8
+ displayName: string;
9
+ };
10
+ options: {
11
+ draftAndPublish: boolean;
12
+ };
13
+ pluginOptions: {
14
+ "content-manager": {
15
+ visible: boolean;
16
+ };
17
+ "content-type-builder": {
18
+ visible: boolean;
19
+ };
20
+ };
21
+ attributes: {
22
+ enabled: {
23
+ type: string;
24
+ default: boolean;
25
+ };
26
+ enforce: {
27
+ type: string;
28
+ default: boolean;
29
+ };
30
+ issuer: {
31
+ type: string;
32
+ required: boolean;
33
+ default: string;
34
+ };
35
+ email_enabled: {
36
+ type: string;
37
+ default: boolean;
38
+ };
39
+ from_email: {
40
+ type: string;
41
+ required: boolean;
42
+ default: string;
43
+ };
44
+ from_name: {
45
+ type: string;
46
+ required: boolean;
47
+ default: string;
48
+ };
49
+ response_email: {
50
+ type: string;
51
+ required: boolean;
52
+ default: string;
53
+ };
54
+ subject: {
55
+ type: string;
56
+ required: boolean;
57
+ default: string;
58
+ };
59
+ text: {
60
+ type: string;
61
+ required: boolean;
62
+ default: string;
63
+ };
64
+ message: {
65
+ type: string;
66
+ required: boolean;
67
+ default: string;
68
+ };
69
+ };
70
+ };
71
+ };
72
+ export default _default;
@@ -0,0 +1,72 @@
1
+ declare const _default: {
2
+ "kind": "singleType",
3
+ "collectionName": "strapi-identity-config",
4
+ "info": {
5
+ "singularName": "strapi-identity-config",
6
+ "pluralName": "strapi-identity-configs",
7
+ "displayName": "Strapi Identity Config"
8
+ },
9
+ "options": {
10
+ "draftAndPublish": false
11
+ },
12
+ "pluginOptions": {
13
+ "content-manager": {
14
+ "visible": false
15
+ },
16
+ "content-type-builder": {
17
+ "visible": false
18
+ }
19
+ },
20
+ "attributes": {
21
+ "enabled": {
22
+ "type": "boolean",
23
+ "default": false
24
+ },
25
+ "enforce": {
26
+ "type": "boolean",
27
+ "default": false
28
+ },
29
+ "issuer": {
30
+ "type": "string",
31
+ "required": false,
32
+ "default": "Strapi"
33
+ },
34
+ "email_enabled": {
35
+ "type": "boolean",
36
+ "default": false
37
+ },
38
+ "from_email": {
39
+ "type": "string",
40
+ "required": false,
41
+ "default": ""
42
+ },
43
+ "from_name": {
44
+ "type": "string",
45
+ "required": false,
46
+ "default": ""
47
+ },
48
+ "response_email": {
49
+ "type": "string",
50
+ "required": false,
51
+ "default": ""
52
+ },
53
+ "subject": {
54
+ "type": "string",
55
+ "required": false,
56
+ "default": ""
57
+ },
58
+ "text": {
59
+ "type": "text",
60
+ "required": false,
61
+ "default": ""
62
+ },
63
+ "message": {
64
+ "type": "text",
65
+ "required": false,
66
+ "default": ""
67
+ }
68
+ }
69
+ }
70
+ ;
71
+
72
+ export default _default;
@@ -0,0 +1,48 @@
1
+ declare const _default: {
2
+ schema: {
3
+ kind: string;
4
+ collectionName: string;
5
+ info: {
6
+ singularName: string;
7
+ pluralName: string;
8
+ displayName: string;
9
+ };
10
+ options: {
11
+ draftAndPublish: boolean;
12
+ };
13
+ pluginOptions: {
14
+ "content-manager": {
15
+ visible: boolean;
16
+ };
17
+ "content-type-builder": {
18
+ visible: boolean;
19
+ };
20
+ };
21
+ attributes: {
22
+ admin_user: {
23
+ type: string;
24
+ relation: string;
25
+ target: string;
26
+ };
27
+ code_hash: {
28
+ type: string;
29
+ required: boolean;
30
+ private: boolean;
31
+ };
32
+ expires_at: {
33
+ type: string;
34
+ required: boolean;
35
+ };
36
+ attempts: {
37
+ type: string;
38
+ default: number;
39
+ };
40
+ purpose: {
41
+ type: string;
42
+ enum: string[];
43
+ default: string;
44
+ };
45
+ };
46
+ };
47
+ };
48
+ export default _default;
@@ -0,0 +1,48 @@
1
+ declare const _default: {
2
+ "kind": "collectionType",
3
+ "collectionName": "email-otps",
4
+ "info": {
5
+ "singularName": "email-otp",
6
+ "pluralName": "email-otps",
7
+ "displayName": "Email OTP"
8
+ },
9
+ "options": {
10
+ "draftAndPublish": false
11
+ },
12
+ "pluginOptions": {
13
+ "content-manager": {
14
+ "visible": false
15
+ },
16
+ "content-type-builder": {
17
+ "visible": false
18
+ }
19
+ },
20
+ "attributes": {
21
+ "admin_user": {
22
+ "type": "relation",
23
+ "relation": "oneToOne",
24
+ "target": "admin::user"
25
+ },
26
+ "code_hash": {
27
+ "type": "string",
28
+ "required": true,
29
+ "private": true
30
+ },
31
+ "expires_at": {
32
+ "type": "string",
33
+ "required": true
34
+ },
35
+ "attempts": {
36
+ "type": "integer",
37
+ "default": 0
38
+ },
39
+ "purpose": {
40
+ "type": "enumeration",
41
+ "enum": ["login", "setup", "disable"],
42
+ "default": "login"
43
+ }
44
+ }
45
+ }
46
+ ;
47
+
48
+ export default _default;
@@ -0,0 +1,3 @@
1
+ import { Plugin } from '@strapi/types';
2
+ declare const contentTypes: Plugin.LoadedPlugin['contentTypes'];
3
+ export default contentTypes;
@@ -0,0 +1,55 @@
1
+ declare const _default: {
2
+ schema: {
3
+ kind: string;
4
+ collectionName: string;
5
+ info: {
6
+ singularName: string;
7
+ pluralName: string;
8
+ displayName: string;
9
+ };
10
+ options: {
11
+ draftAndPublish: boolean;
12
+ };
13
+ pluginOptions: {
14
+ "content-manager": {
15
+ visible: boolean;
16
+ };
17
+ "content-type-builder": {
18
+ visible: boolean;
19
+ };
20
+ };
21
+ attributes: {
22
+ admin_user: {
23
+ type: string;
24
+ relation: string;
25
+ target: string;
26
+ };
27
+ enabled: {
28
+ type: string;
29
+ default: boolean;
30
+ };
31
+ type: {
32
+ type: string;
33
+ enum: string[];
34
+ default: string;
35
+ };
36
+ secret: {
37
+ type: string;
38
+ private: boolean;
39
+ };
40
+ counter: {
41
+ type: string;
42
+ default: string;
43
+ };
44
+ digits: {
45
+ type: string;
46
+ default: number;
47
+ };
48
+ recovery_codes: {
49
+ type: string;
50
+ private: boolean;
51
+ };
52
+ };
53
+ };
54
+ };
55
+ export default _default;
@@ -0,0 +1,55 @@
1
+ declare const _default: {
2
+ "kind": "collectionType",
3
+ "collectionName": "mfa-tokens",
4
+ "info": {
5
+ "singularName": "mfa-token",
6
+ "pluralName": "mfa-tokens",
7
+ "displayName": "MFA Token"
8
+ },
9
+ "options": {
10
+ "draftAndPublish": false
11
+ },
12
+ "pluginOptions": {
13
+ "content-manager": {
14
+ "visible": false
15
+ },
16
+ "content-type-builder": {
17
+ "visible": false
18
+ }
19
+ },
20
+ "attributes": {
21
+ "admin_user": {
22
+ "type": "relation",
23
+ "relation": "oneToOne",
24
+ "target": "admin::user"
25
+ },
26
+ "enabled": {
27
+ "type": "boolean",
28
+ "default": false
29
+ },
30
+ "type": {
31
+ "type": "enumeration",
32
+ "enum": ["totp", "hotp", "email"],
33
+ "default": "totp"
34
+ },
35
+ "secret": {
36
+ "type": "string",
37
+ "private": true
38
+ },
39
+ "counter": {
40
+ "type": "biginteger",
41
+ "default": "0"
42
+ },
43
+ "digits": {
44
+ "type": "integer",
45
+ "default": 6
46
+ },
47
+ "recovery_codes": {
48
+ "type": "json",
49
+ "private": true
50
+ }
51
+ }
52
+ }
53
+ ;
54
+
55
+ export default _default;
@@ -0,0 +1,35 @@
1
+ declare const _default: {
2
+ schema: {
3
+ kind: string;
4
+ collectionName: string;
5
+ info: {
6
+ singularName: string;
7
+ pluralName: string;
8
+ displayName: string;
9
+ };
10
+ options: {
11
+ draftAndPublish: boolean;
12
+ };
13
+ pluginOptions: {
14
+ "content-manager": {
15
+ visible: boolean;
16
+ };
17
+ "content-type-builder": {
18
+ visible: boolean;
19
+ };
20
+ };
21
+ attributes: {
22
+ admin_user: {
23
+ type: string;
24
+ relation: string;
25
+ target: string;
26
+ };
27
+ secret: {
28
+ type: string;
29
+ required: boolean;
30
+ private: boolean;
31
+ };
32
+ };
33
+ };
34
+ };
35
+ export default _default;