@baseplate-dev/plugin-auth 0.6.12 → 0.6.14
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 +40 -0
- package/dist/better-auth/admin/generators/admin-crud-manage-roles-action/admin-crud-manage-roles-action.generator.d.ts +14 -0
- package/dist/better-auth/admin/generators/admin-crud-manage-roles-action/generated/index.d.ts +14 -0
- package/dist/better-auth/admin/generators/admin-crud-manage-roles-action/generated/template-renderers.d.ts +7 -0
- package/dist/better-auth/admin/generators/admin-crud-manage-roles-action/generated/typed-templates.d.ts +7 -0
- package/dist/better-auth/admin/generators/admin-crud-reset-password-action/admin-crud-reset-password-action.generator.d.ts +14 -0
- package/dist/better-auth/admin/generators/admin-crud-reset-password-action/generated/index.d.ts +14 -0
- package/dist/better-auth/admin/generators/admin-crud-reset-password-action/generated/template-renderers.d.ts +7 -0
- package/dist/better-auth/admin/generators/admin-crud-reset-password-action/generated/typed-templates.d.ts +14 -0
- package/dist/better-auth/admin/generators/admin-crud-roles-column/admin-crud-roles-column.generator.d.ts +7 -0
- package/dist/better-auth/constants/packages.d.ts +1 -1
- package/dist/better-auth/constants/packages.js +1 -1
- package/dist/better-auth/generators/fastify/better-auth-admin-module/better-auth-admin-module.generator.d.ts +1 -0
- package/dist/better-auth/generators/fastify/better-auth-admin-module/generated/index.d.ts +2 -0
- package/dist/better-auth/generators/fastify/better-auth-admin-module/generated/template-renderers.d.ts +1 -0
- package/dist/better-auth/generators/fastify/better-auth-admin-module/generated/typed-templates.d.ts +1 -0
- package/dist/better-auth/generators/fastify/better-auth-email-templates/better-auth-email-templates.generator.d.ts +1 -0
- package/dist/better-auth/generators/fastify/better-auth-email-templates/generated/index.d.ts +4 -0
- package/dist/better-auth/generators/fastify/better-auth-email-templates/generated/template-renderers.d.ts +1 -0
- package/dist/better-auth/generators/fastify/better-auth-email-templates/generated/typed-templates.d.ts +3 -0
- package/dist/better-auth/generators/fastify/better-auth-module/better-auth-module.generator.d.ts +43 -6
- package/dist/better-auth/generators/fastify/better-auth-module/better-auth-module.generator.js +21 -2
- package/dist/better-auth/generators/fastify/better-auth-module/generated/index.d.ts +46 -10
- package/dist/better-auth/generators/fastify/better-auth-module/generated/template-renderers.d.ts +18 -2
- package/dist/better-auth/generators/fastify/better-auth-module/generated/template-renderers.js +6 -2
- package/dist/better-auth/generators/fastify/better-auth-module/generated/ts-import-providers.d.ts +24 -6
- package/dist/better-auth/generators/fastify/better-auth-module/generated/ts-import-providers.js +8 -5
- package/dist/better-auth/generators/fastify/better-auth-module/generated/typed-templates.d.ts +20 -4
- package/dist/better-auth/generators/fastify/better-auth-module/generated/typed-templates.js +10 -5
- package/dist/better-auth/generators/fastify/better-auth-module/templates/module/plugins/better-auth.plugin.ts +7 -4
- package/dist/better-auth/generators/fastify/better-auth-module/templates/module/services/auth.ts +76 -59
- package/dist/better-auth/generators/fastify/better-auth-module/templates/module/services/user-session.service.ts +58 -46
- package/dist/better-auth/generators/react/better-auth-pages/better-auth-pages.generator.d.ts +7 -0
- package/dist/better-auth/generators/react/better-auth-pages/generated/index.d.ts +42 -0
- package/dist/better-auth/generators/react/better-auth-pages/generated/template-renderers.d.ts +7 -0
- package/dist/better-auth/generators/react/better-auth-pages/generated/typed-templates.d.ts +70 -0
- package/dist/better-auth/generators/react/react-better-auth/generated/index.d.ts +14 -0
- package/dist/better-auth/generators/react/react-better-auth/generated/template-renderers.d.ts +7 -0
- package/dist/better-auth/generators/react/react-better-auth/generated/typed-templates.d.ts +7 -0
- package/dist/better-auth/generators/react/react-better-auth/react-better-auth.generator.d.ts +7 -0
- package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/admin-crud-manage-roles-action.generator.d.ts +14 -0
- package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/index.d.ts +14 -0
- package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/template-renderers.d.ts +7 -0
- package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/typed-templates.d.ts +7 -0
- package/dist/local-auth/admin/generators/admin-crud-reset-password-action/admin-crud-reset-password-action.generator.d.ts +14 -0
- package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/index.d.ts +14 -0
- package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/template-renderers.d.ts +7 -0
- package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/typed-templates.d.ts +14 -0
- package/dist/local-auth/admin/generators/admin-crud-roles-column/admin-crud-roles-column.generator.d.ts +7 -0
- package/dist/local-auth/core/generators/auth-email-password/auth-email-password.generator.d.ts +7 -23
- package/dist/local-auth/core/generators/auth-email-password/generated/index.d.ts +28 -66
- package/dist/local-auth/core/generators/auth-email-password/generated/template-renderers.d.ts +7 -23
- package/dist/local-auth/core/generators/auth-email-password/generated/template-renderers.js +2 -8
- package/dist/local-auth/core/generators/auth-email-password/generated/typed-templates.d.ts +35 -66
- package/dist/local-auth/core/generators/auth-email-password/generated/typed-templates.js +1 -5
- package/dist/local-auth/core/generators/auth-email-password/templates/module/services/email-verification.service.d.ts +2 -2
- package/dist/local-auth/core/generators/auth-email-password/templates/module/services/email-verification.service.js +2 -2
- package/dist/local-auth/core/generators/auth-email-password/templates/module/services/email-verification.service.ts +8 -4
- package/dist/local-auth/core/generators/auth-email-password/templates/module/services/password-reset.service.d.ts +3 -3
- package/dist/local-auth/core/generators/auth-email-password/templates/module/services/password-reset.service.js +4 -3
- package/dist/local-auth/core/generators/auth-email-password/templates/module/services/password-reset.service.ts +9 -6
- package/dist/local-auth/core/generators/auth-email-password/templates/module/services/user-password.service.js +2 -3
- package/dist/local-auth/core/generators/auth-email-password/templates/module/services/user-password.service.ts +5 -3
- package/dist/local-auth/core/generators/auth-email-templates/auth-email-templates.generator.d.ts +1 -0
- package/dist/local-auth/core/generators/auth-email-templates/generated/index.d.ts +4 -0
- package/dist/local-auth/core/generators/auth-email-templates/generated/template-renderers.d.ts +1 -0
- package/dist/local-auth/core/generators/auth-email-templates/generated/typed-templates.d.ts +3 -0
- package/dist/local-auth/core/generators/auth-module/auth-module.generator.d.ts +62 -8
- package/dist/local-auth/core/generators/auth-module/auth-module.generator.js +21 -11
- package/dist/local-auth/core/generators/auth-module/generated/index.d.ts +152 -10
- package/dist/local-auth/core/generators/auth-module/generated/template-paths.d.ts +1 -0
- package/dist/local-auth/core/generators/auth-module/generated/template-paths.js +1 -0
- package/dist/local-auth/core/generators/auth-module/generated/template-renderers.d.ts +52 -2
- package/dist/local-auth/core/generators/auth-module/generated/template-renderers.js +14 -4
- package/dist/local-auth/core/generators/auth-module/generated/ts-import-providers.d.ts +9 -3
- package/dist/local-auth/core/generators/auth-module/generated/ts-import-providers.js +6 -3
- package/dist/local-auth/core/generators/auth-module/generated/typed-templates.d.ts +102 -8
- package/dist/local-auth/core/generators/auth-module/generated/typed-templates.js +19 -5
- package/dist/local-auth/core/generators/auth-module/templates/module/queues/cleanup-auth-verification.queue.d.ts +0 -4
- package/dist/local-auth/core/generators/auth-module/templates/module/queues/cleanup-auth-verification.queue.js +2 -15
- package/dist/local-auth/core/generators/auth-module/templates/module/queues/cleanup-auth-verification.queue.ts +2 -16
- package/dist/local-auth/core/generators/auth-module/templates/module/queues/cleanup-auth-verification.worker.d.ts +6 -0
- package/dist/local-auth/core/generators/auth-module/templates/module/queues/cleanup-auth-verification.worker.js +18 -0
- package/dist/local-auth/core/generators/auth-module/templates/module/queues/cleanup-auth-verification.worker.ts +22 -0
- package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-session.mutations.js +1 -2
- package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-session.mutations.ts +4 -2
- package/dist/local-auth/core/generators/auth-module/templates/module/services/user-session.service.d.ts +0 -1
- package/dist/local-auth/core/generators/auth-module/templates/module/services/user-session.service.js +0 -1
- package/dist/local-auth/core/generators/auth-module/templates/module/services/user-session.service.ts +0 -2
- package/dist/local-auth/core/generators/auth-routes/auth-routes.generator.d.ts +9 -0
- package/dist/local-auth/core/generators/auth-routes/generated/index.d.ts +52 -0
- package/dist/local-auth/core/generators/auth-routes/generated/template-renderers.d.ts +9 -0
- package/dist/local-auth/core/generators/auth-routes/generated/typed-templates.d.ts +77 -0
- package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/login.js +1 -1
- package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/login.tsx +1 -1
- package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/register.js +1 -1
- package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/register.tsx +1 -1
- package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/reset-password.js +2 -2
- package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/reset-password.tsx +2 -2
- package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/verify-email.js +1 -1
- package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/verify-email.tsx +1 -1
- package/dist/local-auth/core/generators/react-session/generated/index.d.ts +14 -0
- package/dist/local-auth/core/generators/react-session/generated/template-renderers.d.ts +7 -0
- package/dist/local-auth/core/generators/react-session/generated/typed-templates.d.ts +14 -0
- package/dist/local-auth/core/generators/react-session/react-session.generator.d.ts +7 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/index.d.ts +2 -2
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/ts-import-providers.d.ts +10 -2
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/ts-import-providers.js +8 -5
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/typed-templates.js +1 -1
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/index.d.ts +3 -1
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/index.js +2 -1
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/{auth-module.generator.d.ts → placeholder-auth-module.generator.d.ts} +20 -3
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/{auth-module.generator.js → placeholder-auth-module.generator.js} +16 -1
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/templates/module/services/user-session.service.d.ts +5 -21
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/templates/module/services/user-session.service.js +17 -26
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/templates/module/services/user-session.service.ts +21 -31
- package/dist/web/assets/{_virtual_mf-localSharedImportMap___mfe_internal__plugin_mf_2_auth-Bd_uRhIr.js → _virtual_mf-localSharedImportMap___mfe_internal__plugin_mf_2_auth-3sV-KVGF.js} +89 -73
- package/dist/web/assets/{_virtual_mf___mfe_internal__plugin_mf_2_auth__loadShare___mf_0_baseplate_mf_2_dev_mf_1_project_mf_2_builder_mf_2_lib__loadShare__.js-BX1_Ngjt.js → _virtual_mf___mfe_internal__plugin_mf_2_auth__loadShare___mf_0_baseplate_mf_2_dev_mf_1_project_mf_2_builder_mf_2_lib__loadShare__.js-0m3QgjSy.js} +50 -13
- package/dist/web/assets/{_virtual_mf___mfe_internal__plugin_mf_2_auth__loadShare___mf_0_baseplate_mf_2_dev_mf_1_project_mf_2_builder_mf_2_lib_mf_1_web__loadShare__.js-CQuBII8a.js → _virtual_mf___mfe_internal__plugin_mf_2_auth__loadShare___mf_0_baseplate_mf_2_dev_mf_1_project_mf_2_builder_mf_2_lib_mf_1_web__loadShare__.js-QrOyqu9V.js} +50 -14
- package/dist/web/assets/{_virtual_mf___mfe_internal__plugin_mf_2_auth__loadShare___mf_0_baseplate_mf_2_dev_mf_1_ui_mf_2_components__loadShare__.js-DsLoA9K7.js → _virtual_mf___mfe_internal__plugin_mf_2_auth__loadShare___mf_0_baseplate_mf_2_dev_mf_1_ui_mf_2_components__loadShare__.js-BTSgZGcl.js} +6932 -6106
- package/dist/web/assets/{_virtual_mf___mfe_internal__plugin_mf_2_auth__loadShare___mf_0_tanstack_mf_1_react_mf_2_router__loadShare__.js-CGsbw2Lx.js → _virtual_mf___mfe_internal__plugin_mf_2_auth__loadShare___mf_0_tanstack_mf_1_react_mf_2_router__loadShare__.js-CJ027_El.js} +72 -151
- package/dist/web/assets/{_virtual_mf___mfe_internal__plugin_mf_2_auth__loadShare__zod__loadShare__.js-DE4UUe5K.js → _virtual_mf___mfe_internal__plugin_mf_2_auth__loadShare__zod__loadShare__.js-Do-7VDVw.js} +30 -247
- package/dist/web/assets/auth-D8BnFQKk.js +1 -0
- package/dist/web/assets/{common-CLtpg163.js → common-7-ZtKO5B.js} +3 -3
- package/dist/web/assets/{common-ooa00sM_.js → common-Aq-HXybV.js} +6 -6
- package/dist/web/assets/{common-C0Hur22D.js → common-B8N9gx2s.js} +4 -4
- package/dist/web/assets/{common-BFKR_7HQ.js → common-BPbNs2A1.js} +6 -6
- package/dist/web/assets/{common-CTYcv1u_.js → common-B_XZ3l9w.js} +3 -3
- package/dist/web/assets/{common-B8Z1_D6-.js → common-CDrUdhRf.js} +4 -4
- package/dist/web/assets/{dist-DicVrB_Z.js → dist-D3CkiDKT.js} +387 -262
- package/dist/web/assets/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__plugin-auth__remoteEntry_js-CtbvyMZJ.js → dist-SBfmsOB2.js} +43 -359
- package/dist/web/assets/{get-auth-plugin-definition-DBdchbBZ.js → get-auth-plugin-definition-D3ocnNxw.js} +2 -2
- package/dist/web/assets/hostInit-D3RxwboF.js +99 -0
- package/dist/web/assets/{index-CR54yoeW.js → index-CozZxQl1.js} +2 -2
- package/dist/web/assets/{mf-entry-bootstrap-0-4f84e81c.js → mf-entry-bootstrap-0-069a3ab2.js} +5 -2
- package/dist/web/assets/{model-utils-CQpTF3uf.js → model-utils-CYaLYwoX.js} +48 -14
- package/dist/web/assets/{models-Bc3L4Vsl.js → models-BX4xFiEn.js} +3 -3
- package/dist/web/assets/{models-BIKzGkW3.js → models-k-iaCft-.js} +3 -3
- package/dist/web/assets/{plugin-definition-33i4r91s.js → plugin-definition-BI565qFo.js} +3 -3
- package/dist/web/assets/{plugin-definition-BhNnSvrD.js → plugin-definition-CI1aEVGv.js} +3 -3
- package/dist/web/assets/{styles-BT_OTXuv.js → styles-f4jHVv0S.js} +15 -12
- package/dist/web/assets/{virtualExposes-B_hX31Ln.js → virtualExposes-BHQhgLE-.js} +1 -1
- package/dist/web/assets/virtual_mf-REMOTE_ENTRY_ID___mfe_internal__plugin-auth__remoteEntry_js-aH8n-Nbe.js +259 -0
- package/dist/web/assets/{virtual_mf-exposes-ssr___mfe_internal__plugin-auth__remoteEntry_js-BVNjo6R7.js → virtual_mf-exposes-ssr___mfe_internal__plugin-auth__remoteEntry_js-I_SxfvGj.js} +13 -13
- package/dist/web/assets/{virtual_mf-exposes___mfe_internal__plugin-auth__remoteEntry_js-B_7IVc8D.js → virtual_mf-exposes___mfe_internal__plugin-auth__remoteEntry_js-BQ0UMKSv.js} +50 -15
- package/dist/web/assets/{web-Dso6eI9u.js → web-BRvS0HRS.js} +17 -17
- package/dist/web/assets/{web-aKoJoBnQ.js → web-CkbTu31Q.js} +16 -16
- package/dist/web/assets/{web-DYbNyLPi.js → web-Cn3uvuFs.js} +35 -35
- package/dist/web/assets/{web-BDeHApaZ.js → web-DCK_tLVa.js} +31 -18
- package/dist/web/assets/{web-BXB-pvWJ.js → web-Dh6pUTrF.js} +20 -20
- package/dist/web/assets/{web-CJlCNegu.js → web-YXVJWeXy.js} +3 -3
- package/dist/web/assets/{web-BC9MejP0.js → web-nLSlkJy_.js} +3 -3
- package/dist/web/index.html +2 -2
- package/dist/web/remoteEntry.js +1 -1
- package/dist/web/remoteEntry.ssr.js +1 -1
- package/package.json +26 -26
- package/dist/web/assets/auth-DS8ZnZZr.js +0 -1
- package/dist/web/assets/hostInit-CDVLjNbq.js +0 -119
|
@@ -31,7 +31,10 @@ export declare const LOCAL_AUTH_CORE_AUTH_EMAIL_PASSWORD_GENERATED: {
|
|
|
31
31
|
localAuthCoreAuthEmailPasswordRenderers: import("@baseplate-dev/sync").ProviderExport<import("./template-renderers.js").LocalAuthCoreAuthEmailPasswordRenderers>;
|
|
32
32
|
}, {
|
|
33
33
|
authModuleImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
|
|
34
|
+
cleanupAuthVerificationQueue: {};
|
|
35
|
+
cleanupAuthVerificationWorker: {};
|
|
34
36
|
cleanupExpiredAuthVerifications: {};
|
|
37
|
+
CookieUserSessionService: {};
|
|
35
38
|
createAuthVerification: {};
|
|
36
39
|
userSessionPayload: {};
|
|
37
40
|
validateAuthVerification: {};
|
|
@@ -39,26 +42,6 @@ export declare const LOCAL_AUTH_CORE_AUTH_EMAIL_PASSWORD_GENERATED: {
|
|
|
39
42
|
configServiceImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
|
|
40
43
|
config: {};
|
|
41
44
|
}>>;
|
|
42
|
-
emailModuleImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
|
|
43
|
-
EmailAdapter: {
|
|
44
|
-
isTypeOnly: true;
|
|
45
|
-
};
|
|
46
|
-
EmailAttachment: {
|
|
47
|
-
isTypeOnly: true;
|
|
48
|
-
};
|
|
49
|
-
EmailRawOptions: {
|
|
50
|
-
isTypeOnly: true;
|
|
51
|
-
};
|
|
52
|
-
EmailSendOptions: {
|
|
53
|
-
isTypeOnly: true;
|
|
54
|
-
};
|
|
55
|
-
sendEmail: {};
|
|
56
|
-
sendEmailQueue: {};
|
|
57
|
-
sendRawEmail: {};
|
|
58
|
-
TransformedEmailMessage: {
|
|
59
|
-
isTypeOnly: true;
|
|
60
|
-
};
|
|
61
|
-
}>>;
|
|
62
45
|
errorHandlerServiceImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
|
|
63
46
|
BadRequestError: {};
|
|
64
47
|
ForbiddenError: {};
|
|
@@ -67,6 +50,7 @@ export declare const LOCAL_AUTH_CORE_AUTH_EMAIL_PASSWORD_GENERATED: {
|
|
|
67
50
|
InternalServerError: {};
|
|
68
51
|
logError: {};
|
|
69
52
|
NotFoundError: {};
|
|
53
|
+
throwIfPrismaNotFound: {};
|
|
70
54
|
TooManyRequestsError: {};
|
|
71
55
|
UnauthorizedError: {};
|
|
72
56
|
}>>;
|
|
@@ -105,11 +89,11 @@ export declare const LOCAL_AUTH_CORE_AUTH_EMAIL_PASSWORD_GENERATED: {
|
|
|
105
89
|
RequestServiceContext: {
|
|
106
90
|
isTypeOnly: true;
|
|
107
91
|
};
|
|
92
|
+
RequestServiceContextWith: {
|
|
93
|
+
isTypeOnly: true;
|
|
94
|
+
};
|
|
108
95
|
}>>;
|
|
109
96
|
typescriptFile: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").TypescriptFileProvider>;
|
|
110
|
-
userSessionServiceImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
|
|
111
|
-
userSessionService: {};
|
|
112
|
-
}>>;
|
|
113
97
|
userSessionTypesImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
|
|
114
98
|
UserSessionPayload: {
|
|
115
99
|
isTypeOnly: true;
|
|
@@ -135,7 +119,10 @@ export declare const LOCAL_AUTH_CORE_AUTH_EMAIL_PASSWORD_GENERATED: {
|
|
|
135
119
|
TPL_USER_OBJECT_TYPE: {};
|
|
136
120
|
}, {
|
|
137
121
|
authModuleImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
|
|
122
|
+
cleanupAuthVerificationQueue: {};
|
|
123
|
+
cleanupAuthVerificationWorker: {};
|
|
138
124
|
cleanupExpiredAuthVerifications: {};
|
|
125
|
+
CookieUserSessionService: {};
|
|
139
126
|
createAuthVerification: {};
|
|
140
127
|
userSessionPayload: {};
|
|
141
128
|
validateAuthVerification: {};
|
|
@@ -151,7 +138,10 @@ export declare const LOCAL_AUTH_CORE_AUTH_EMAIL_PASSWORD_GENERATED: {
|
|
|
151
138
|
TPL_PASSWORD_RESET_EMAIL: {};
|
|
152
139
|
}, {
|
|
153
140
|
authModuleImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
|
|
141
|
+
cleanupAuthVerificationQueue: {};
|
|
142
|
+
cleanupAuthVerificationWorker: {};
|
|
154
143
|
cleanupExpiredAuthVerifications: {};
|
|
144
|
+
CookieUserSessionService: {};
|
|
155
145
|
createAuthVerification: {};
|
|
156
146
|
userSessionPayload: {};
|
|
157
147
|
validateAuthVerification: {};
|
|
@@ -159,26 +149,6 @@ export declare const LOCAL_AUTH_CORE_AUTH_EMAIL_PASSWORD_GENERATED: {
|
|
|
159
149
|
configServiceImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
|
|
160
150
|
config: {};
|
|
161
151
|
}>>;
|
|
162
|
-
emailModuleImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
|
|
163
|
-
EmailAdapter: {
|
|
164
|
-
isTypeOnly: true;
|
|
165
|
-
};
|
|
166
|
-
EmailAttachment: {
|
|
167
|
-
isTypeOnly: true;
|
|
168
|
-
};
|
|
169
|
-
EmailRawOptions: {
|
|
170
|
-
isTypeOnly: true;
|
|
171
|
-
};
|
|
172
|
-
EmailSendOptions: {
|
|
173
|
-
isTypeOnly: true;
|
|
174
|
-
};
|
|
175
|
-
sendEmail: {};
|
|
176
|
-
sendEmailQueue: {};
|
|
177
|
-
sendRawEmail: {};
|
|
178
|
-
TransformedEmailMessage: {
|
|
179
|
-
isTypeOnly: true;
|
|
180
|
-
};
|
|
181
|
-
}>>;
|
|
182
152
|
errorHandlerServiceImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
|
|
183
153
|
BadRequestError: {};
|
|
184
154
|
ForbiddenError: {};
|
|
@@ -187,6 +157,7 @@ export declare const LOCAL_AUTH_CORE_AUTH_EMAIL_PASSWORD_GENERATED: {
|
|
|
187
157
|
InternalServerError: {};
|
|
188
158
|
logError: {};
|
|
189
159
|
NotFoundError: {};
|
|
160
|
+
throwIfPrismaNotFound: {};
|
|
190
161
|
TooManyRequestsError: {};
|
|
191
162
|
UnauthorizedError: {};
|
|
192
163
|
}>>;
|
|
@@ -215,6 +186,9 @@ export declare const LOCAL_AUTH_CORE_AUTH_EMAIL_PASSWORD_GENERATED: {
|
|
|
215
186
|
RequestServiceContext: {
|
|
216
187
|
isTypeOnly: true;
|
|
217
188
|
};
|
|
189
|
+
RequestServiceContextWith: {
|
|
190
|
+
isTypeOnly: true;
|
|
191
|
+
};
|
|
218
192
|
}>>;
|
|
219
193
|
}, {
|
|
220
194
|
constantsPassword: {};
|
|
@@ -231,6 +205,7 @@ export declare const LOCAL_AUTH_CORE_AUTH_EMAIL_PASSWORD_GENERATED: {
|
|
|
231
205
|
InternalServerError: {};
|
|
232
206
|
logError: {};
|
|
233
207
|
NotFoundError: {};
|
|
208
|
+
throwIfPrismaNotFound: {};
|
|
234
209
|
TooManyRequestsError: {};
|
|
235
210
|
UnauthorizedError: {};
|
|
236
211
|
}>>;
|
|
@@ -265,9 +240,9 @@ export declare const LOCAL_AUTH_CORE_AUTH_EMAIL_PASSWORD_GENERATED: {
|
|
|
265
240
|
RequestServiceContext: {
|
|
266
241
|
isTypeOnly: true;
|
|
267
242
|
};
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
243
|
+
RequestServiceContextWith: {
|
|
244
|
+
isTypeOnly: true;
|
|
245
|
+
};
|
|
271
246
|
}>>;
|
|
272
247
|
userSessionTypesImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
|
|
273
248
|
UserSessionPayload: {
|
|
@@ -293,7 +268,10 @@ export declare const LOCAL_AUTH_CORE_AUTH_EMAIL_PASSWORD_GENERATED: {
|
|
|
293
268
|
TPL_ACCOUNT_VERIFICATION_EMAIL: {};
|
|
294
269
|
}, {
|
|
295
270
|
authModuleImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
|
|
271
|
+
cleanupAuthVerificationQueue: {};
|
|
272
|
+
cleanupAuthVerificationWorker: {};
|
|
296
273
|
cleanupExpiredAuthVerifications: {};
|
|
274
|
+
CookieUserSessionService: {};
|
|
297
275
|
createAuthVerification: {};
|
|
298
276
|
userSessionPayload: {};
|
|
299
277
|
validateAuthVerification: {};
|
|
@@ -301,26 +279,6 @@ export declare const LOCAL_AUTH_CORE_AUTH_EMAIL_PASSWORD_GENERATED: {
|
|
|
301
279
|
configServiceImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
|
|
302
280
|
config: {};
|
|
303
281
|
}>>;
|
|
304
|
-
emailModuleImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
|
|
305
|
-
EmailAdapter: {
|
|
306
|
-
isTypeOnly: true;
|
|
307
|
-
};
|
|
308
|
-
EmailAttachment: {
|
|
309
|
-
isTypeOnly: true;
|
|
310
|
-
};
|
|
311
|
-
EmailRawOptions: {
|
|
312
|
-
isTypeOnly: true;
|
|
313
|
-
};
|
|
314
|
-
EmailSendOptions: {
|
|
315
|
-
isTypeOnly: true;
|
|
316
|
-
};
|
|
317
|
-
sendEmail: {};
|
|
318
|
-
sendEmailQueue: {};
|
|
319
|
-
sendRawEmail: {};
|
|
320
|
-
TransformedEmailMessage: {
|
|
321
|
-
isTypeOnly: true;
|
|
322
|
-
};
|
|
323
|
-
}>>;
|
|
324
282
|
errorHandlerServiceImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
|
|
325
283
|
BadRequestError: {};
|
|
326
284
|
ForbiddenError: {};
|
|
@@ -329,6 +287,7 @@ export declare const LOCAL_AUTH_CORE_AUTH_EMAIL_PASSWORD_GENERATED: {
|
|
|
329
287
|
InternalServerError: {};
|
|
330
288
|
logError: {};
|
|
331
289
|
NotFoundError: {};
|
|
290
|
+
throwIfPrismaNotFound: {};
|
|
332
291
|
TooManyRequestsError: {};
|
|
333
292
|
UnauthorizedError: {};
|
|
334
293
|
}>>;
|
|
@@ -353,6 +312,9 @@ export declare const LOCAL_AUTH_CORE_AUTH_EMAIL_PASSWORD_GENERATED: {
|
|
|
353
312
|
RequestServiceContext: {
|
|
354
313
|
isTypeOnly: true;
|
|
355
314
|
};
|
|
315
|
+
RequestServiceContextWith: {
|
|
316
|
+
isTypeOnly: true;
|
|
317
|
+
};
|
|
356
318
|
}>>;
|
|
357
319
|
}, {
|
|
358
320
|
constantsPassword: {};
|
package/dist/local-auth/core/generators/auth-email-password/generated/template-renderers.d.ts
CHANGED
|
@@ -18,7 +18,10 @@ export declare const LOCAL_AUTH_CORE_AUTH_EMAIL_PASSWORD_RENDERERS: {
|
|
|
18
18
|
localAuthCoreAuthEmailPasswordRenderers: import("@baseplate-dev/sync").ProviderExport<LocalAuthCoreAuthEmailPasswordRenderers>;
|
|
19
19
|
}, {
|
|
20
20
|
authModuleImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
|
|
21
|
+
cleanupAuthVerificationQueue: {};
|
|
22
|
+
cleanupAuthVerificationWorker: {};
|
|
21
23
|
cleanupExpiredAuthVerifications: {};
|
|
24
|
+
CookieUserSessionService: {};
|
|
22
25
|
createAuthVerification: {};
|
|
23
26
|
userSessionPayload: {};
|
|
24
27
|
validateAuthVerification: {};
|
|
@@ -26,26 +29,6 @@ export declare const LOCAL_AUTH_CORE_AUTH_EMAIL_PASSWORD_RENDERERS: {
|
|
|
26
29
|
configServiceImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
|
|
27
30
|
config: {};
|
|
28
31
|
}>>;
|
|
29
|
-
emailModuleImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
|
|
30
|
-
EmailAdapter: {
|
|
31
|
-
isTypeOnly: true;
|
|
32
|
-
};
|
|
33
|
-
EmailAttachment: {
|
|
34
|
-
isTypeOnly: true;
|
|
35
|
-
};
|
|
36
|
-
EmailRawOptions: {
|
|
37
|
-
isTypeOnly: true;
|
|
38
|
-
};
|
|
39
|
-
EmailSendOptions: {
|
|
40
|
-
isTypeOnly: true;
|
|
41
|
-
};
|
|
42
|
-
sendEmail: {};
|
|
43
|
-
sendEmailQueue: {};
|
|
44
|
-
sendRawEmail: {};
|
|
45
|
-
TransformedEmailMessage: {
|
|
46
|
-
isTypeOnly: true;
|
|
47
|
-
};
|
|
48
|
-
}>>;
|
|
49
32
|
errorHandlerServiceImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
|
|
50
33
|
BadRequestError: {};
|
|
51
34
|
ForbiddenError: {};
|
|
@@ -54,6 +37,7 @@ export declare const LOCAL_AUTH_CORE_AUTH_EMAIL_PASSWORD_RENDERERS: {
|
|
|
54
37
|
InternalServerError: {};
|
|
55
38
|
logError: {};
|
|
56
39
|
NotFoundError: {};
|
|
40
|
+
throwIfPrismaNotFound: {};
|
|
57
41
|
TooManyRequestsError: {};
|
|
58
42
|
UnauthorizedError: {};
|
|
59
43
|
}>>;
|
|
@@ -92,11 +76,11 @@ export declare const LOCAL_AUTH_CORE_AUTH_EMAIL_PASSWORD_RENDERERS: {
|
|
|
92
76
|
RequestServiceContext: {
|
|
93
77
|
isTypeOnly: true;
|
|
94
78
|
};
|
|
79
|
+
RequestServiceContextWith: {
|
|
80
|
+
isTypeOnly: true;
|
|
81
|
+
};
|
|
95
82
|
}>>;
|
|
96
83
|
typescriptFile: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").TypescriptFileProvider>;
|
|
97
|
-
userSessionServiceImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
|
|
98
|
-
userSessionService: {};
|
|
99
|
-
}>>;
|
|
100
84
|
userSessionTypesImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
|
|
101
85
|
UserSessionPayload: {
|
|
102
86
|
isTypeOnly: true;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { typescriptFileProvider } from '@baseplate-dev/core-generators';
|
|
2
|
-
import { configServiceImportsProvider, errorHandlerServiceImportsProvider, passwordHasherServiceImportsProvider, pothosImportsProvider, prismaGeneratedImportsProvider, prismaImportsProvider, requestServiceContextImportsProvider,
|
|
3
|
-
import { emailModuleImportsProvider } from '@baseplate-dev/plugin-email';
|
|
2
|
+
import { configServiceImportsProvider, errorHandlerServiceImportsProvider, passwordHasherServiceImportsProvider, pothosImportsProvider, prismaGeneratedImportsProvider, prismaImportsProvider, requestServiceContextImportsProvider, userSessionTypesImportsProvider, } from '@baseplate-dev/fastify-generators';
|
|
4
3
|
import { rateLimitImportsProvider } from '@baseplate-dev/plugin-rate-limit';
|
|
5
4
|
import { createGeneratorTask, createProviderType } from '@baseplate-dev/sync';
|
|
6
5
|
import { authModuleImportsProvider } from '#src/local-auth/core/generators/auth-module/generated/ts-import-providers.js';
|
|
@@ -11,7 +10,6 @@ const localAuthCoreAuthEmailPasswordRenderersTask = createGeneratorTask({
|
|
|
11
10
|
dependencies: {
|
|
12
11
|
authModuleImports: authModuleImportsProvider,
|
|
13
12
|
configServiceImports: configServiceImportsProvider,
|
|
14
|
-
emailModuleImports: emailModuleImportsProvider,
|
|
15
13
|
errorHandlerServiceImports: errorHandlerServiceImportsProvider,
|
|
16
14
|
passwordHasherServiceImports: passwordHasherServiceImportsProvider,
|
|
17
15
|
paths: LOCAL_AUTH_CORE_AUTH_EMAIL_PASSWORD_PATHS.provider,
|
|
@@ -21,13 +19,12 @@ const localAuthCoreAuthEmailPasswordRenderersTask = createGeneratorTask({
|
|
|
21
19
|
rateLimitImports: rateLimitImportsProvider,
|
|
22
20
|
requestServiceContextImports: requestServiceContextImportsProvider,
|
|
23
21
|
typescriptFile: typescriptFileProvider,
|
|
24
|
-
userSessionServiceImports: userSessionServiceImportsProvider,
|
|
25
22
|
userSessionTypesImports: userSessionTypesImportsProvider,
|
|
26
23
|
},
|
|
27
24
|
exports: {
|
|
28
25
|
localAuthCoreAuthEmailPasswordRenderers: localAuthCoreAuthEmailPasswordRenderers.export(),
|
|
29
26
|
},
|
|
30
|
-
run({ authModuleImports, configServiceImports,
|
|
27
|
+
run({ authModuleImports, configServiceImports, errorHandlerServiceImports, passwordHasherServiceImports, paths, pothosImports, prismaGeneratedImports, prismaImports, rateLimitImports, requestServiceContextImports, typescriptFile, userSessionTypesImports, }) {
|
|
31
28
|
return {
|
|
32
29
|
providers: {
|
|
33
30
|
localAuthCoreAuthEmailPasswordRenderers: {
|
|
@@ -38,7 +35,6 @@ const localAuthCoreAuthEmailPasswordRenderersTask = createGeneratorTask({
|
|
|
38
35
|
importMapProviders: {
|
|
39
36
|
authModuleImports,
|
|
40
37
|
configServiceImports,
|
|
41
|
-
emailModuleImports,
|
|
42
38
|
errorHandlerServiceImports,
|
|
43
39
|
passwordHasherServiceImports,
|
|
44
40
|
pothosImports,
|
|
@@ -46,7 +42,6 @@ const localAuthCoreAuthEmailPasswordRenderersTask = createGeneratorTask({
|
|
|
46
42
|
prismaImports,
|
|
47
43
|
rateLimitImports,
|
|
48
44
|
requestServiceContextImports,
|
|
49
|
-
userSessionServiceImports,
|
|
50
45
|
userSessionTypesImports,
|
|
51
46
|
},
|
|
52
47
|
generatorPaths: paths,
|
|
@@ -71,7 +66,6 @@ const localAuthCoreAuthEmailPasswordRenderersTask = createGeneratorTask({
|
|
|
71
66
|
importMapProviders: {
|
|
72
67
|
authModuleImports,
|
|
73
68
|
configServiceImports,
|
|
74
|
-
emailModuleImports,
|
|
75
69
|
errorHandlerServiceImports,
|
|
76
70
|
prismaImports,
|
|
77
71
|
rateLimitImports,
|
|
@@ -12,7 +12,10 @@ export declare const moduleGroup: {
|
|
|
12
12
|
TPL_USER_OBJECT_TYPE: {};
|
|
13
13
|
}, {
|
|
14
14
|
authModuleImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
|
|
15
|
+
cleanupAuthVerificationQueue: {};
|
|
16
|
+
cleanupAuthVerificationWorker: {};
|
|
15
17
|
cleanupExpiredAuthVerifications: {};
|
|
18
|
+
CookieUserSessionService: {};
|
|
16
19
|
createAuthVerification: {};
|
|
17
20
|
userSessionPayload: {};
|
|
18
21
|
validateAuthVerification: {};
|
|
@@ -28,7 +31,10 @@ export declare const moduleGroup: {
|
|
|
28
31
|
TPL_PASSWORD_RESET_EMAIL: {};
|
|
29
32
|
}, {
|
|
30
33
|
authModuleImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
|
|
34
|
+
cleanupAuthVerificationQueue: {};
|
|
35
|
+
cleanupAuthVerificationWorker: {};
|
|
31
36
|
cleanupExpiredAuthVerifications: {};
|
|
37
|
+
CookieUserSessionService: {};
|
|
32
38
|
createAuthVerification: {};
|
|
33
39
|
userSessionPayload: {};
|
|
34
40
|
validateAuthVerification: {};
|
|
@@ -36,26 +42,6 @@ export declare const moduleGroup: {
|
|
|
36
42
|
configServiceImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
|
|
37
43
|
config: {};
|
|
38
44
|
}>>;
|
|
39
|
-
emailModuleImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
|
|
40
|
-
EmailAdapter: {
|
|
41
|
-
isTypeOnly: true;
|
|
42
|
-
};
|
|
43
|
-
EmailAttachment: {
|
|
44
|
-
isTypeOnly: true;
|
|
45
|
-
};
|
|
46
|
-
EmailRawOptions: {
|
|
47
|
-
isTypeOnly: true;
|
|
48
|
-
};
|
|
49
|
-
EmailSendOptions: {
|
|
50
|
-
isTypeOnly: true;
|
|
51
|
-
};
|
|
52
|
-
sendEmail: {};
|
|
53
|
-
sendEmailQueue: {};
|
|
54
|
-
sendRawEmail: {};
|
|
55
|
-
TransformedEmailMessage: {
|
|
56
|
-
isTypeOnly: true;
|
|
57
|
-
};
|
|
58
|
-
}>>;
|
|
59
45
|
errorHandlerServiceImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
|
|
60
46
|
BadRequestError: {};
|
|
61
47
|
ForbiddenError: {};
|
|
@@ -64,6 +50,7 @@ export declare const moduleGroup: {
|
|
|
64
50
|
InternalServerError: {};
|
|
65
51
|
logError: {};
|
|
66
52
|
NotFoundError: {};
|
|
53
|
+
throwIfPrismaNotFound: {};
|
|
67
54
|
TooManyRequestsError: {};
|
|
68
55
|
UnauthorizedError: {};
|
|
69
56
|
}>>;
|
|
@@ -92,6 +79,9 @@ export declare const moduleGroup: {
|
|
|
92
79
|
RequestServiceContext: {
|
|
93
80
|
isTypeOnly: true;
|
|
94
81
|
};
|
|
82
|
+
RequestServiceContextWith: {
|
|
83
|
+
isTypeOnly: true;
|
|
84
|
+
};
|
|
95
85
|
}>>;
|
|
96
86
|
}, {
|
|
97
87
|
constantsPassword: {};
|
|
@@ -108,6 +98,7 @@ export declare const moduleGroup: {
|
|
|
108
98
|
InternalServerError: {};
|
|
109
99
|
logError: {};
|
|
110
100
|
NotFoundError: {};
|
|
101
|
+
throwIfPrismaNotFound: {};
|
|
111
102
|
TooManyRequestsError: {};
|
|
112
103
|
UnauthorizedError: {};
|
|
113
104
|
}>>;
|
|
@@ -142,9 +133,9 @@ export declare const moduleGroup: {
|
|
|
142
133
|
RequestServiceContext: {
|
|
143
134
|
isTypeOnly: true;
|
|
144
135
|
};
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
136
|
+
RequestServiceContextWith: {
|
|
137
|
+
isTypeOnly: true;
|
|
138
|
+
};
|
|
148
139
|
}>>;
|
|
149
140
|
userSessionTypesImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
|
|
150
141
|
UserSessionPayload: {
|
|
@@ -174,7 +165,10 @@ export declare const LOCAL_AUTH_CORE_AUTH_EMAIL_PASSWORD_TEMPLATES: {
|
|
|
174
165
|
TPL_USER_OBJECT_TYPE: {};
|
|
175
166
|
}, {
|
|
176
167
|
authModuleImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
|
|
168
|
+
cleanupAuthVerificationQueue: {};
|
|
169
|
+
cleanupAuthVerificationWorker: {};
|
|
177
170
|
cleanupExpiredAuthVerifications: {};
|
|
171
|
+
CookieUserSessionService: {};
|
|
178
172
|
createAuthVerification: {};
|
|
179
173
|
userSessionPayload: {};
|
|
180
174
|
validateAuthVerification: {};
|
|
@@ -190,7 +184,10 @@ export declare const LOCAL_AUTH_CORE_AUTH_EMAIL_PASSWORD_TEMPLATES: {
|
|
|
190
184
|
TPL_PASSWORD_RESET_EMAIL: {};
|
|
191
185
|
}, {
|
|
192
186
|
authModuleImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
|
|
187
|
+
cleanupAuthVerificationQueue: {};
|
|
188
|
+
cleanupAuthVerificationWorker: {};
|
|
193
189
|
cleanupExpiredAuthVerifications: {};
|
|
190
|
+
CookieUserSessionService: {};
|
|
194
191
|
createAuthVerification: {};
|
|
195
192
|
userSessionPayload: {};
|
|
196
193
|
validateAuthVerification: {};
|
|
@@ -198,26 +195,6 @@ export declare const LOCAL_AUTH_CORE_AUTH_EMAIL_PASSWORD_TEMPLATES: {
|
|
|
198
195
|
configServiceImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
|
|
199
196
|
config: {};
|
|
200
197
|
}>>;
|
|
201
|
-
emailModuleImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
|
|
202
|
-
EmailAdapter: {
|
|
203
|
-
isTypeOnly: true;
|
|
204
|
-
};
|
|
205
|
-
EmailAttachment: {
|
|
206
|
-
isTypeOnly: true;
|
|
207
|
-
};
|
|
208
|
-
EmailRawOptions: {
|
|
209
|
-
isTypeOnly: true;
|
|
210
|
-
};
|
|
211
|
-
EmailSendOptions: {
|
|
212
|
-
isTypeOnly: true;
|
|
213
|
-
};
|
|
214
|
-
sendEmail: {};
|
|
215
|
-
sendEmailQueue: {};
|
|
216
|
-
sendRawEmail: {};
|
|
217
|
-
TransformedEmailMessage: {
|
|
218
|
-
isTypeOnly: true;
|
|
219
|
-
};
|
|
220
|
-
}>>;
|
|
221
198
|
errorHandlerServiceImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
|
|
222
199
|
BadRequestError: {};
|
|
223
200
|
ForbiddenError: {};
|
|
@@ -226,6 +203,7 @@ export declare const LOCAL_AUTH_CORE_AUTH_EMAIL_PASSWORD_TEMPLATES: {
|
|
|
226
203
|
InternalServerError: {};
|
|
227
204
|
logError: {};
|
|
228
205
|
NotFoundError: {};
|
|
206
|
+
throwIfPrismaNotFound: {};
|
|
229
207
|
TooManyRequestsError: {};
|
|
230
208
|
UnauthorizedError: {};
|
|
231
209
|
}>>;
|
|
@@ -254,6 +232,9 @@ export declare const LOCAL_AUTH_CORE_AUTH_EMAIL_PASSWORD_TEMPLATES: {
|
|
|
254
232
|
RequestServiceContext: {
|
|
255
233
|
isTypeOnly: true;
|
|
256
234
|
};
|
|
235
|
+
RequestServiceContextWith: {
|
|
236
|
+
isTypeOnly: true;
|
|
237
|
+
};
|
|
257
238
|
}>>;
|
|
258
239
|
}, {
|
|
259
240
|
constantsPassword: {};
|
|
@@ -270,6 +251,7 @@ export declare const LOCAL_AUTH_CORE_AUTH_EMAIL_PASSWORD_TEMPLATES: {
|
|
|
270
251
|
InternalServerError: {};
|
|
271
252
|
logError: {};
|
|
272
253
|
NotFoundError: {};
|
|
254
|
+
throwIfPrismaNotFound: {};
|
|
273
255
|
TooManyRequestsError: {};
|
|
274
256
|
UnauthorizedError: {};
|
|
275
257
|
}>>;
|
|
@@ -304,9 +286,9 @@ export declare const LOCAL_AUTH_CORE_AUTH_EMAIL_PASSWORD_TEMPLATES: {
|
|
|
304
286
|
RequestServiceContext: {
|
|
305
287
|
isTypeOnly: true;
|
|
306
288
|
};
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
289
|
+
RequestServiceContextWith: {
|
|
290
|
+
isTypeOnly: true;
|
|
291
|
+
};
|
|
310
292
|
}>>;
|
|
311
293
|
userSessionTypesImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
|
|
312
294
|
UserSessionPayload: {
|
|
@@ -332,7 +314,10 @@ export declare const LOCAL_AUTH_CORE_AUTH_EMAIL_PASSWORD_TEMPLATES: {
|
|
|
332
314
|
TPL_ACCOUNT_VERIFICATION_EMAIL: {};
|
|
333
315
|
}, {
|
|
334
316
|
authModuleImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
|
|
317
|
+
cleanupAuthVerificationQueue: {};
|
|
318
|
+
cleanupAuthVerificationWorker: {};
|
|
335
319
|
cleanupExpiredAuthVerifications: {};
|
|
320
|
+
CookieUserSessionService: {};
|
|
336
321
|
createAuthVerification: {};
|
|
337
322
|
userSessionPayload: {};
|
|
338
323
|
validateAuthVerification: {};
|
|
@@ -340,26 +325,6 @@ export declare const LOCAL_AUTH_CORE_AUTH_EMAIL_PASSWORD_TEMPLATES: {
|
|
|
340
325
|
configServiceImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
|
|
341
326
|
config: {};
|
|
342
327
|
}>>;
|
|
343
|
-
emailModuleImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
|
|
344
|
-
EmailAdapter: {
|
|
345
|
-
isTypeOnly: true;
|
|
346
|
-
};
|
|
347
|
-
EmailAttachment: {
|
|
348
|
-
isTypeOnly: true;
|
|
349
|
-
};
|
|
350
|
-
EmailRawOptions: {
|
|
351
|
-
isTypeOnly: true;
|
|
352
|
-
};
|
|
353
|
-
EmailSendOptions: {
|
|
354
|
-
isTypeOnly: true;
|
|
355
|
-
};
|
|
356
|
-
sendEmail: {};
|
|
357
|
-
sendEmailQueue: {};
|
|
358
|
-
sendRawEmail: {};
|
|
359
|
-
TransformedEmailMessage: {
|
|
360
|
-
isTypeOnly: true;
|
|
361
|
-
};
|
|
362
|
-
}>>;
|
|
363
328
|
errorHandlerServiceImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
|
|
364
329
|
BadRequestError: {};
|
|
365
330
|
ForbiddenError: {};
|
|
@@ -368,6 +333,7 @@ export declare const LOCAL_AUTH_CORE_AUTH_EMAIL_PASSWORD_TEMPLATES: {
|
|
|
368
333
|
InternalServerError: {};
|
|
369
334
|
logError: {};
|
|
370
335
|
NotFoundError: {};
|
|
336
|
+
throwIfPrismaNotFound: {};
|
|
371
337
|
TooManyRequestsError: {};
|
|
372
338
|
UnauthorizedError: {};
|
|
373
339
|
}>>;
|
|
@@ -392,6 +358,9 @@ export declare const LOCAL_AUTH_CORE_AUTH_EMAIL_PASSWORD_TEMPLATES: {
|
|
|
392
358
|
RequestServiceContext: {
|
|
393
359
|
isTypeOnly: true;
|
|
394
360
|
};
|
|
361
|
+
RequestServiceContextWith: {
|
|
362
|
+
isTypeOnly: true;
|
|
363
|
+
};
|
|
395
364
|
}>>;
|
|
396
365
|
}, {
|
|
397
366
|
constantsPassword: {};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { createTsTemplateFile } from '@baseplate-dev/core-generators';
|
|
2
|
-
import { configServiceImportsProvider, errorHandlerServiceImportsProvider, passwordHasherServiceImportsProvider, pothosImportsProvider, prismaGeneratedImportsProvider, prismaImportsProvider, requestServiceContextImportsProvider,
|
|
3
|
-
import { emailModuleImportsProvider } from '@baseplate-dev/plugin-email';
|
|
2
|
+
import { configServiceImportsProvider, errorHandlerServiceImportsProvider, passwordHasherServiceImportsProvider, pothosImportsProvider, prismaGeneratedImportsProvider, prismaImportsProvider, requestServiceContextImportsProvider, userSessionTypesImportsProvider, } from '@baseplate-dev/fastify-generators';
|
|
4
3
|
import { rateLimitImportsProvider } from '@baseplate-dev/plugin-rate-limit';
|
|
5
4
|
import path from 'node:path';
|
|
6
5
|
import { authModuleImportsProvider } from '#src/local-auth/core/generators/auth-module/generated/ts-import-providers.js';
|
|
@@ -50,7 +49,6 @@ const servicesPasswordReset = createTsTemplateFile({
|
|
|
50
49
|
importMapProviders: {
|
|
51
50
|
authModuleImports: authModuleImportsProvider,
|
|
52
51
|
configServiceImports: configServiceImportsProvider,
|
|
53
|
-
emailModuleImports: emailModuleImportsProvider,
|
|
54
52
|
errorHandlerServiceImports: errorHandlerServiceImportsProvider,
|
|
55
53
|
passwordHasherServiceImports: passwordHasherServiceImportsProvider,
|
|
56
54
|
prismaImports: prismaImportsProvider,
|
|
@@ -83,7 +81,6 @@ const servicesUserPassword = createTsTemplateFile({
|
|
|
83
81
|
prismaImports: prismaImportsProvider,
|
|
84
82
|
rateLimitImports: rateLimitImportsProvider,
|
|
85
83
|
requestServiceContextImports: requestServiceContextImportsProvider,
|
|
86
|
-
userSessionServiceImports: userSessionServiceImportsProvider,
|
|
87
84
|
userSessionTypesImports: userSessionTypesImportsProvider,
|
|
88
85
|
},
|
|
89
86
|
name: 'services-user-password',
|
|
@@ -123,7 +120,6 @@ const servicesEmailVerification = createTsTemplateFile({
|
|
|
123
120
|
importMapProviders: {
|
|
124
121
|
authModuleImports: authModuleImportsProvider,
|
|
125
122
|
configServiceImports: configServiceImportsProvider,
|
|
126
|
-
emailModuleImports: emailModuleImportsProvider,
|
|
127
123
|
errorHandlerServiceImports: errorHandlerServiceImportsProvider,
|
|
128
124
|
prismaImports: prismaImportsProvider,
|
|
129
125
|
rateLimitImports: rateLimitImportsProvider,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { RequestServiceContext } from '%requestServiceContextImports';
|
|
1
|
+
import type { RequestServiceContext, RequestServiceContextWith } from '%requestServiceContextImports';
|
|
2
2
|
/**
|
|
3
3
|
* Request an email verification for the authenticated user.
|
|
4
4
|
* Sends a verification email with a link to verify.
|
|
5
5
|
*/
|
|
6
6
|
export declare function requestEmailVerification({ userId, context, }: {
|
|
7
7
|
userId: string;
|
|
8
|
-
context:
|
|
8
|
+
context: RequestServiceContextWith<'email'>;
|
|
9
9
|
}): Promise<{
|
|
10
10
|
success: true;
|
|
11
11
|
}>;
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import { EMAIL_VERIFICATION_TOKEN_EXPIRY_SEC } from '$constantsPassword';
|
|
3
3
|
import { createAuthVerification, validateAuthVerification, } from '%authModuleImports';
|
|
4
4
|
import { config } from '%configServiceImports';
|
|
5
|
-
import { sendEmail } from '%emailModuleImports';
|
|
6
5
|
import { BadRequestError } from '%errorHandlerServiceImports';
|
|
7
6
|
import { prisma } from '%prismaImports';
|
|
8
7
|
import { memoizeRateLimiter } from '%rateLimitImports';
|
|
@@ -30,6 +29,7 @@ const getVerifyEmailIpLimiter = memoizeRateLimiter('verify-email-ip', {
|
|
|
30
29
|
* Sends a verification email with a link to verify.
|
|
31
30
|
*/
|
|
32
31
|
export async function requestEmailVerification({ userId, context, }) {
|
|
32
|
+
const { services } = context;
|
|
33
33
|
await Promise.all([
|
|
34
34
|
getRequestEmailVerificationIpLimiter().consumeOrThrow(context.reqInfo.ip, 'Too many verification attempts. Please try again later.', 'too-many-requests'),
|
|
35
35
|
getRequestEmailVerificationUserLimiter().consumeOrThrow(userId, 'Too many verification attempts. Please try again later.', 'too-many-requests'),
|
|
@@ -51,7 +51,7 @@ export async function requestEmailVerification({ userId, context, }) {
|
|
|
51
51
|
});
|
|
52
52
|
// Construct verification URL using configured domain
|
|
53
53
|
const verifyLink = `${config.AUTH_FRONTEND_URL}/auth/verify-email?token=${encodeURIComponent(token)}`;
|
|
54
|
-
await
|
|
54
|
+
await services.email.send(TPL_ACCOUNT_VERIFICATION_EMAIL, {
|
|
55
55
|
to: user.email,
|
|
56
56
|
data: { verifyLink },
|
|
57
57
|
});
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
2
|
|
|
3
|
-
import type {
|
|
3
|
+
import type {
|
|
4
|
+
RequestServiceContext,
|
|
5
|
+
RequestServiceContextWith,
|
|
6
|
+
} from '%requestServiceContextImports';
|
|
4
7
|
|
|
5
8
|
import { EMAIL_VERIFICATION_TOKEN_EXPIRY_SEC } from '$constantsPassword';
|
|
6
9
|
import {
|
|
@@ -8,7 +11,6 @@ import {
|
|
|
8
11
|
validateAuthVerification,
|
|
9
12
|
} from '%authModuleImports';
|
|
10
13
|
import { config } from '%configServiceImports';
|
|
11
|
-
import { sendEmail } from '%emailModuleImports';
|
|
12
14
|
import { BadRequestError } from '%errorHandlerServiceImports';
|
|
13
15
|
import { prisma } from '%prismaImports';
|
|
14
16
|
import { memoizeRateLimiter } from '%rateLimitImports';
|
|
@@ -52,8 +54,10 @@ export async function requestEmailVerification({
|
|
|
52
54
|
context,
|
|
53
55
|
}: {
|
|
54
56
|
userId: string;
|
|
55
|
-
context:
|
|
57
|
+
context: RequestServiceContextWith<'email'>;
|
|
56
58
|
}): Promise<{ success: true }> {
|
|
59
|
+
const { services } = context;
|
|
60
|
+
|
|
57
61
|
await Promise.all([
|
|
58
62
|
getRequestEmailVerificationIpLimiter().consumeOrThrow(
|
|
59
63
|
context.reqInfo.ip,
|
|
@@ -89,7 +93,7 @@ export async function requestEmailVerification({
|
|
|
89
93
|
// Construct verification URL using configured domain
|
|
90
94
|
const verifyLink = `${config.AUTH_FRONTEND_URL}/auth/verify-email?token=${encodeURIComponent(token)}`;
|
|
91
95
|
|
|
92
|
-
await
|
|
96
|
+
await services.email.send(TPL_ACCOUNT_VERIFICATION_EMAIL, {
|
|
93
97
|
to: user.email,
|
|
94
98
|
data: { verifyLink },
|
|
95
99
|
});
|