strapi-identity 0.4.2 → 0.5.1

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-DOmsyqwQ.mjs → AdminReset-DjVX7phX.mjs} +1 -1
  2. package/dist/admin/{AdminReset-BiWQDTRv.js → AdminReset-DsKz040S.js} +1 -1
  3. package/dist/admin/{ProfileToggle-BUqs_hxZ.js → ProfileToggle-4u6WWddz.js} +1 -1
  4. package/dist/admin/{ProfileToggle-k0d-caPC.mjs → ProfileToggle-B1UK1opI.mjs} +1 -1
  5. package/dist/admin/{SettingsPage-Dm_llkYv.mjs → SettingsPage-CcHTu8-f.mjs} +1 -1
  6. package/dist/admin/{SettingsPage-DVVkN1xw.js → SettingsPage-DZDW9kNI.js} +1 -1
  7. package/dist/admin/{index-DpIJdETG.mjs → index-Bm3H4z3W.mjs} +41 -20
  8. package/dist/admin/{index-B9P8S4CX.js → index-Ce4QOU6Y.js} +41 -20
  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 +72 -46
  29. package/dist/server/index.mjs +72 -46
  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
@@ -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;
@@ -0,0 +1,35 @@
1
+ declare const _default: {
2
+ "kind": "collectionType",
3
+ "collectionName": "mfa-temps",
4
+ "info": {
5
+ "singularName": "mfa-temp",
6
+ "pluralName": "mfa-temps",
7
+ "displayName": "MFA Temp"
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
+ "secret": {
27
+ "type": "string",
28
+ "required": false,
29
+ "private": true
30
+ }
31
+ }
32
+ }
33
+ ;
34
+
35
+ export default _default;
@@ -0,0 +1,4 @@
1
+ import { Plugin } from '@strapi/types';
2
+ type controller = Plugin.LoadedPlugin['controllers'][string];
3
+ declare const _default: controller;
4
+ export default _default;
@@ -0,0 +1,4 @@
1
+ import { Plugin } from '@strapi/types';
2
+ type controller = Plugin.LoadedPlugin['controllers'][string];
3
+ declare const _default: controller;
4
+ export default _default;
@@ -0,0 +1,8 @@
1
+ import { Core } from '@strapi/strapi';
2
+ import { Plugin } from '@strapi/types';
3
+ type controller = Plugin.LoadedPlugin['controllers'][string];
4
+ declare const controller: ({ strapi }: {
5
+ strapi: Core.Strapi;
6
+ }) => controller;
7
+ declare const _default: controller;
8
+ export default _default;
@@ -0,0 +1,3 @@
1
+ import { Plugin } from '@strapi/strapi';
2
+ declare const controllers: Plugin.LoadedPlugin['controllers'];
3
+ export default controllers;
@@ -0,0 +1,3 @@
1
+ import { Plugin } from '@strapi/types';
2
+ declare const destroy: Plugin.LoadedPlugin['destroy'];
3
+ export default destroy;
@@ -0,0 +1,3 @@
1
+ import { Plugin } from '@strapi/types';
2
+ declare const middlewares: Plugin.LoadedPlugin['middlewares'];
3
+ export default middlewares;
@@ -0,0 +1,3 @@
1
+ import { Plugin } from '@strapi/types';
2
+ declare const policy: Plugin.LoadedPlugin['policies'][string];
3
+ export default policy;
@@ -0,0 +1,3 @@
1
+ import { Plugin } from '@strapi/types';
2
+ declare const policies: Plugin.LoadedPlugin['policies'];
3
+ export default policies;
@@ -0,0 +1,3 @@
1
+ import { Plugin } from '@strapi/types';
2
+ declare const register: Plugin.LoadedPlugin['register'];
3
+ export default register;
@@ -0,0 +1,35 @@
1
+ declare const _default: [
2
+ {
3
+ "method": "GET",
4
+ "path": "/admin/user/:id",
5
+ "handler": "admin.isEnabled",
6
+ "info": { "apiName": "isEnabled", "pluginName": "strapi-identity", "type": "content-api" },
7
+ "config": {
8
+ "policies": [
9
+ "admin::isAuthenticatedAdmin",
10
+ {
11
+ "name": "admin::hasPermissions",
12
+ "config": { "actions": ["plugin::strapi-identity.settings.read"] }
13
+ }
14
+ ]
15
+ }
16
+ },
17
+ {
18
+ "method": "DELETE",
19
+ "path": "/admin/user/:id",
20
+ "handler": "admin.reset",
21
+ "info": { "apiName": "reset", "pluginName": "strapi-identity", "type": "content-api" },
22
+ "config": {
23
+ "policies": [
24
+ "admin::isAuthenticatedAdmin",
25
+ {
26
+ "name": "admin::hasPermissions",
27
+ "config": { "actions": ["plugin::strapi-identity.settings.update"] }
28
+ }
29
+ ]
30
+ }
31
+ }
32
+ ]
33
+ ;
34
+
35
+ export default _default;
@@ -0,0 +1,50 @@
1
+ declare const _default: [
2
+ {
3
+ "method": "GET",
4
+ "path": "/config/enabled",
5
+ "handler": "config.isEnabled",
6
+ "info": { "apiName": "isEnabled", "pluginName": "strapi-identity", "type": "content-api" },
7
+ "config": {
8
+ "policies": [
9
+ "admin::isAuthenticatedAdmin",
10
+ {
11
+ "name": "admin::hasPermissions",
12
+ "config": { "actions": ["plugin::strapi-identity.settings.read"] }
13
+ }
14
+ ]
15
+ }
16
+ },
17
+ {
18
+ "method": "GET",
19
+ "path": "/config",
20
+ "handler": "config.getConfig",
21
+ "info": { "apiName": "getConfig", "pluginName": "strapi-identity", "type": "content-api" },
22
+ "config": {
23
+ "policies": [
24
+ "admin::isAuthenticatedAdmin",
25
+ {
26
+ "name": "admin::hasPermissions",
27
+ "config": { "actions": ["plugin::strapi-identity.settings.read"] }
28
+ }
29
+ ]
30
+ }
31
+ },
32
+ {
33
+ "method": "PUT",
34
+ "path": "/config",
35
+ "handler": "config.updateConfig",
36
+ "info": { "apiName": "updateConfig", "pluginName": "strapi-identity", "type": "content-api" },
37
+ "config": {
38
+ "policies": [
39
+ "admin::isAuthenticatedAdmin",
40
+ {
41
+ "name": "admin::hasPermissions",
42
+ "config": { "actions": ["plugin::strapi-identity.settings.update"] }
43
+ }
44
+ ]
45
+ }
46
+ }
47
+ ]
48
+ ;
49
+
50
+ export default _default;
@@ -0,0 +1,3 @@
1
+ import { Plugin } from '@strapi/types';
2
+ declare const _default: Plugin.LoadedPlugin["routes"]["admin"];
3
+ export default _default;
@@ -0,0 +1,94 @@
1
+ declare const _default: [
2
+ {
3
+ "method": "GET",
4
+ "path": "/verify/info",
5
+ "handler": "controller.verifyInfo",
6
+ "info": { "apiName": "verifyInfo", "pluginName": "strapi-identity", "type": "content-api" },
7
+ "config": {
8
+ "auth": false,
9
+ "policies": ["has-mfa"]
10
+ }
11
+ },
12
+ {
13
+ "method": "POST",
14
+ "path": "/verify",
15
+ "handler": "controller.verify",
16
+ "info": { "apiName": "verify", "pluginName": "strapi-identity", "type": "content-api" },
17
+ "config": {
18
+ "auth": false,
19
+ "policies": ["has-mfa"],
20
+ "middlewares": ["admin::rateLimit"]
21
+ }
22
+ },
23
+ {
24
+ "method": "POST",
25
+ "path": "/enable",
26
+ "handler": "controller.enable",
27
+ "info": { "apiName": "enable", "pluginName": "strapi-identity", "type": "content-api" },
28
+ "config": {}
29
+ },
30
+ {
31
+ "method": "POST",
32
+ "path": "/setup",
33
+ "handler": "controller.setup",
34
+ "info": { "apiName": "setup", "pluginName": "strapi-identity", "type": "content-api" },
35
+ "config": {}
36
+ },
37
+ {
38
+ "method": "POST",
39
+ "path": "/disable",
40
+ "handler": "controller.disable",
41
+ "info": { "apiName": "disable", "pluginName": "strapi-identity", "type": "content-api" },
42
+ "config": {}
43
+ },
44
+ {
45
+ "method": "GET",
46
+ "path": "/status",
47
+ "handler": "controller.checkStatus",
48
+ "info": { "apiName": "checkStatus", "pluginName": "strapi-identity", "type": "content-api" },
49
+ "config": {}
50
+ },
51
+ {
52
+ "method": "POST",
53
+ "path": "/verify/resend",
54
+ "handler": "controller.resendVerifyOTP",
55
+ "info": {
56
+ "apiName": "resendVerifyOTP",
57
+ "pluginName": "strapi-identity",
58
+ "type": "content-api"
59
+ },
60
+ "config": {
61
+ "auth": false,
62
+ "policies": ["has-mfa"],
63
+ "middlewares": ["admin::rateLimit"]
64
+ }
65
+ },
66
+ {
67
+ "method": "POST",
68
+ "path": "/enable-email",
69
+ "handler": "controller.enableEmail",
70
+ "info": { "apiName": "enableEmail", "pluginName": "strapi-identity", "type": "content-api" },
71
+ "config": {}
72
+ },
73
+ {
74
+ "method": "POST",
75
+ "path": "/setup-email",
76
+ "handler": "controller.setupEmail",
77
+ "info": { "apiName": "setupEmail", "pluginName": "strapi-identity", "type": "content-api" },
78
+ "config": {}
79
+ },
80
+ {
81
+ "method": "POST",
82
+ "path": "/disable-email/request",
83
+ "handler": "controller.requestDisableEmailOTP",
84
+ "info": {
85
+ "apiName": "requestDisableEmailOTP",
86
+ "pluginName": "strapi-identity",
87
+ "type": "content-api"
88
+ },
89
+ "config": {}
90
+ }
91
+ ]
92
+ ;
93
+
94
+ export default _default;
@@ -0,0 +1,3 @@
1
+ import { Plugin } from '@strapi/types';
2
+ declare const routes: Plugin.LoadedPlugin['routes'];
3
+ export default routes;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Check if 2FA is enabled for a user by looking for an associated MFA token.
3
+ * @param id the user's ID to check for an associated MFA token, indicating that 2FA is enabled for that user
4
+ * @returns a boolean indicating whether 2FA is enabled for the user (true if an MFA token exists, false otherwise)
5
+ */
6
+ export declare const isEnabled: (id: string) => false | Promise<boolean>;
7
+ /**
8
+ * Resets 2FA for a user by deleting any existing MFA token and temporary secret associated with that user.
9
+ * @param id the user's ID for which to reset 2FA, which will delete any associated MFA token and temporary secret, effectively disabling 2FA for that user until they set it up again
10
+ */
11
+ export declare const reset: (id: string) => Promise<void>;
@@ -0,0 +1,57 @@
1
+ declare const defaultConfig: {
2
+ email_enabled: boolean;
3
+ enabled: boolean;
4
+ enforce: boolean;
5
+ from_email: string;
6
+ from_name: string;
7
+ issuer: string;
8
+ message: string;
9
+ response_email: string;
10
+ subject: string;
11
+ text: string;
12
+ };
13
+ /**
14
+ * Service for managing the Strapi Identity plugin configuration
15
+ * @returns an object containing functions to get and update the plugin configuration
16
+ */
17
+ export declare const isEnabled: () => Promise<boolean>;
18
+ /**
19
+ * Retrieves the current configuration for the Strapi Identity plugin
20
+ * @returns the current configuration
21
+ */
22
+ export declare const getConfig: () => Promise<{
23
+ email_enabled: boolean;
24
+ enabled: boolean;
25
+ enforce: boolean;
26
+ from_email: string;
27
+ from_name: string;
28
+ issuer: string;
29
+ message: string;
30
+ response_email: string;
31
+ subject: string;
32
+ text: string;
33
+ }>;
34
+ /**
35
+ * Updates the Strapi Identity plugin configuration with the provided data
36
+ * @param data partial configuration data to update
37
+ * @returns the updated configuration
38
+ */
39
+ export declare const updateConfig: (data: Partial<typeof defaultConfig>) => Promise<{
40
+ email_enabled: boolean;
41
+ enabled: boolean;
42
+ enforce: boolean;
43
+ from_email: string;
44
+ from_name: string;
45
+ issuer: string;
46
+ message: string;
47
+ response_email: string;
48
+ subject: string;
49
+ text: string;
50
+ }>;
51
+ /**
52
+ * Checks if a user has MFA enabled by verifying the provided JWT token and checking for an associated MFA token in the database
53
+ * @param jwtToken the JWT token to verify and extract the user ID from
54
+ * @returns true if the user has MFA enabled, false otherwise
55
+ */
56
+ export declare const checkUserByJWT: (jwtToken: string) => Promise<boolean>;
57
+ export {};
@@ -0,0 +1,8 @@
1
+ export declare const send: (to: string, otp: string) => Promise<any>;
2
+ /**
3
+ * Replaces template variables in a string with their corresponding values.
4
+ * @param template The template string containing variables in the format <%= VARIABLE %>.
5
+ * @param variables An object containing the variable values to replace in the template.
6
+ * @returns The template string with variables replaced by their corresponding values.
7
+ */
8
+ export declare const replaceTemplateVariables: <T extends Record<string, string>>(template: string, variables: T) => string;