@baseplate-dev/plugin-auth 0.6.11 → 0.6.13
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 +29 -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 +37 -66
- package/dist/local-auth/core/generators/auth-email-password/generated/typed-templates.js +5 -6
- 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-DEljr3MS.js → _virtual_mf-localSharedImportMap___mfe_internal__plugin_mf_2_auth-DxRuC5lD.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-B6a7L2-k.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-Dbjihoi-.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-JKpdJ1L0.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-CpEOtTmq.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-gRzmaSZc.js +1 -0
- package/dist/web/assets/{common-CTWnBc6I.js → common-B4cD6OfF.js} +6 -6
- package/dist/web/assets/{common-g_Gn0v5J.js → common-B9LNVIXT.js} +4 -4
- package/dist/web/assets/{common-kfSP8YQO.js → common-B9sZoKR5.js} +6 -6
- package/dist/web/assets/{common-CzNLnT_1.js → common-DF9FD3lJ.js} +4 -4
- package/dist/web/assets/{common-zfktVQvk.js → common-S36tY-P3.js} +3 -3
- package/dist/web/assets/{common-B3OG-gju.js → common-sMUs9FmV.js} +3 -3
- package/dist/web/assets/{dist-C6kDPCTC.js → dist-CtqdAorB.js} +376 -256
- package/dist/web/assets/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__plugin-auth__remoteEntry_js-Bt9-dftr.js → dist-SBfmsOB2.js} +43 -359
- package/dist/web/assets/{get-auth-plugin-definition-2vFJROjB.js → get-auth-plugin-definition-Bs9C6JrS.js} +2 -2
- package/dist/web/assets/hostInit-BtfjN9sB.js +99 -0
- package/dist/web/assets/{index-Cr47LBtj.js → index-DVCa_MuH.js} +2 -2
- package/dist/web/assets/{mf-entry-bootstrap-0-13480d2a.js → mf-entry-bootstrap-0-31a63adb.js} +5 -2
- package/dist/web/assets/{model-utils-ZF_FVZ_o.js → model-utils-BDM6ILfO.js} +43 -15
- package/dist/web/assets/{models-DPPMgQz_.js → models-1c2urnle.js} +3 -3
- package/dist/web/assets/{models-CORL4i-6.js → models-DGhhwO8Q.js} +3 -3
- package/dist/web/assets/{plugin-definition-UAfMRa7u.js → plugin-definition-B-HRncfN.js} +3 -3
- package/dist/web/assets/{plugin-definition-mNNM2hOB.js → plugin-definition-Dluw2inU.js} +3 -3
- package/dist/web/assets/{styles-DNVWarsT.js → styles-BTmSBHAy.js} +15 -12
- package/dist/web/assets/{virtualExposes-CZsMFYa2.js → virtualExposes-C1o-SyCQ.js} +1 -1
- package/dist/web/assets/virtual_mf-REMOTE_ENTRY_ID___mfe_internal__plugin-auth__remoteEntry_js-Bs76by83.js +259 -0
- package/dist/web/assets/{virtual_mf-exposes-ssr___mfe_internal__plugin-auth__remoteEntry_js-DC8YPV1Z.js → virtual_mf-exposes-ssr___mfe_internal__plugin-auth__remoteEntry_js-B5SkIaaz.js} +13 -13
- package/dist/web/assets/{virtual_mf-exposes___mfe_internal__plugin-auth__remoteEntry_js-CmilMd0E.js → virtual_mf-exposes___mfe_internal__plugin-auth__remoteEntry_js-DotA2McS.js} +50 -15
- package/dist/web/assets/{web-CNMEeTj-.js → web-B2REeIGU.js} +3 -3
- package/dist/web/assets/{web-BldKZtQd.js → web-BEOhczx1.js} +16 -16
- package/dist/web/assets/{web-y8E7eNgy.js → web-Bh_3N1sv.js} +17 -17
- package/dist/web/assets/{web-DiGj_0d0.js → web-CiuxQhgn.js} +20 -20
- package/dist/web/assets/{web-OntIhIfe.js → web-DGv5-Arz.js} +35 -35
- package/dist/web/assets/{web-BbqWFVPH.js → web-jcCkQISW.js} +31 -18
- package/dist/web/assets/{web-CnsQCdFE.js → web-wBaHshVG.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-YjeUffyx.js +0 -1
- package/dist/web/assets/hostInit-35H-qR11.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,9 +186,13 @@ 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: {};
|
|
195
|
+
servicesUserPassword: {};
|
|
221
196
|
}>;
|
|
222
197
|
servicesUserPassword: import("@baseplate-dev/core-generators").TsTemplateFile<{
|
|
223
198
|
TPL_NAME_REQUIRED_CHECK: {};
|
|
@@ -230,6 +205,7 @@ export declare const LOCAL_AUTH_CORE_AUTH_EMAIL_PASSWORD_GENERATED: {
|
|
|
230
205
|
InternalServerError: {};
|
|
231
206
|
logError: {};
|
|
232
207
|
NotFoundError: {};
|
|
208
|
+
throwIfPrismaNotFound: {};
|
|
233
209
|
TooManyRequestsError: {};
|
|
234
210
|
UnauthorizedError: {};
|
|
235
211
|
}>>;
|
|
@@ -264,9 +240,9 @@ export declare const LOCAL_AUTH_CORE_AUTH_EMAIL_PASSWORD_GENERATED: {
|
|
|
264
240
|
RequestServiceContext: {
|
|
265
241
|
isTypeOnly: true;
|
|
266
242
|
};
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
243
|
+
RequestServiceContextWith: {
|
|
244
|
+
isTypeOnly: true;
|
|
245
|
+
};
|
|
270
246
|
}>>;
|
|
271
247
|
userSessionTypesImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
|
|
272
248
|
UserSessionPayload: {
|
|
@@ -292,7 +268,10 @@ export declare const LOCAL_AUTH_CORE_AUTH_EMAIL_PASSWORD_GENERATED: {
|
|
|
292
268
|
TPL_ACCOUNT_VERIFICATION_EMAIL: {};
|
|
293
269
|
}, {
|
|
294
270
|
authModuleImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
|
|
271
|
+
cleanupAuthVerificationQueue: {};
|
|
272
|
+
cleanupAuthVerificationWorker: {};
|
|
295
273
|
cleanupExpiredAuthVerifications: {};
|
|
274
|
+
CookieUserSessionService: {};
|
|
296
275
|
createAuthVerification: {};
|
|
297
276
|
userSessionPayload: {};
|
|
298
277
|
validateAuthVerification: {};
|
|
@@ -300,26 +279,6 @@ export declare const LOCAL_AUTH_CORE_AUTH_EMAIL_PASSWORD_GENERATED: {
|
|
|
300
279
|
configServiceImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
|
|
301
280
|
config: {};
|
|
302
281
|
}>>;
|
|
303
|
-
emailModuleImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
|
|
304
|
-
EmailAdapter: {
|
|
305
|
-
isTypeOnly: true;
|
|
306
|
-
};
|
|
307
|
-
EmailAttachment: {
|
|
308
|
-
isTypeOnly: true;
|
|
309
|
-
};
|
|
310
|
-
EmailRawOptions: {
|
|
311
|
-
isTypeOnly: true;
|
|
312
|
-
};
|
|
313
|
-
EmailSendOptions: {
|
|
314
|
-
isTypeOnly: true;
|
|
315
|
-
};
|
|
316
|
-
sendEmail: {};
|
|
317
|
-
sendEmailQueue: {};
|
|
318
|
-
sendRawEmail: {};
|
|
319
|
-
TransformedEmailMessage: {
|
|
320
|
-
isTypeOnly: true;
|
|
321
|
-
};
|
|
322
|
-
}>>;
|
|
323
282
|
errorHandlerServiceImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
|
|
324
283
|
BadRequestError: {};
|
|
325
284
|
ForbiddenError: {};
|
|
@@ -328,6 +287,7 @@ export declare const LOCAL_AUTH_CORE_AUTH_EMAIL_PASSWORD_GENERATED: {
|
|
|
328
287
|
InternalServerError: {};
|
|
329
288
|
logError: {};
|
|
330
289
|
NotFoundError: {};
|
|
290
|
+
throwIfPrismaNotFound: {};
|
|
331
291
|
TooManyRequestsError: {};
|
|
332
292
|
UnauthorizedError: {};
|
|
333
293
|
}>>;
|
|
@@ -352,6 +312,9 @@ export declare const LOCAL_AUTH_CORE_AUTH_EMAIL_PASSWORD_GENERATED: {
|
|
|
352
312
|
RequestServiceContext: {
|
|
353
313
|
isTypeOnly: true;
|
|
354
314
|
};
|
|
315
|
+
RequestServiceContextWith: {
|
|
316
|
+
isTypeOnly: true;
|
|
317
|
+
};
|
|
355
318
|
}>>;
|
|
356
319
|
}, {
|
|
357
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,9 +79,13 @@ 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: {};
|
|
88
|
+
servicesUserPassword: {};
|
|
98
89
|
}>;
|
|
99
90
|
servicesUserPassword: import("@baseplate-dev/core-generators").TsTemplateFile<{
|
|
100
91
|
TPL_NAME_REQUIRED_CHECK: {};
|
|
@@ -107,6 +98,7 @@ export declare const moduleGroup: {
|
|
|
107
98
|
InternalServerError: {};
|
|
108
99
|
logError: {};
|
|
109
100
|
NotFoundError: {};
|
|
101
|
+
throwIfPrismaNotFound: {};
|
|
110
102
|
TooManyRequestsError: {};
|
|
111
103
|
UnauthorizedError: {};
|
|
112
104
|
}>>;
|
|
@@ -141,9 +133,9 @@ export declare const moduleGroup: {
|
|
|
141
133
|
RequestServiceContext: {
|
|
142
134
|
isTypeOnly: true;
|
|
143
135
|
};
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
136
|
+
RequestServiceContextWith: {
|
|
137
|
+
isTypeOnly: true;
|
|
138
|
+
};
|
|
147
139
|
}>>;
|
|
148
140
|
userSessionTypesImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
|
|
149
141
|
UserSessionPayload: {
|
|
@@ -173,7 +165,10 @@ export declare const LOCAL_AUTH_CORE_AUTH_EMAIL_PASSWORD_TEMPLATES: {
|
|
|
173
165
|
TPL_USER_OBJECT_TYPE: {};
|
|
174
166
|
}, {
|
|
175
167
|
authModuleImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
|
|
168
|
+
cleanupAuthVerificationQueue: {};
|
|
169
|
+
cleanupAuthVerificationWorker: {};
|
|
176
170
|
cleanupExpiredAuthVerifications: {};
|
|
171
|
+
CookieUserSessionService: {};
|
|
177
172
|
createAuthVerification: {};
|
|
178
173
|
userSessionPayload: {};
|
|
179
174
|
validateAuthVerification: {};
|
|
@@ -189,7 +184,10 @@ export declare const LOCAL_AUTH_CORE_AUTH_EMAIL_PASSWORD_TEMPLATES: {
|
|
|
189
184
|
TPL_PASSWORD_RESET_EMAIL: {};
|
|
190
185
|
}, {
|
|
191
186
|
authModuleImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
|
|
187
|
+
cleanupAuthVerificationQueue: {};
|
|
188
|
+
cleanupAuthVerificationWorker: {};
|
|
192
189
|
cleanupExpiredAuthVerifications: {};
|
|
190
|
+
CookieUserSessionService: {};
|
|
193
191
|
createAuthVerification: {};
|
|
194
192
|
userSessionPayload: {};
|
|
195
193
|
validateAuthVerification: {};
|
|
@@ -197,26 +195,6 @@ export declare const LOCAL_AUTH_CORE_AUTH_EMAIL_PASSWORD_TEMPLATES: {
|
|
|
197
195
|
configServiceImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
|
|
198
196
|
config: {};
|
|
199
197
|
}>>;
|
|
200
|
-
emailModuleImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
|
|
201
|
-
EmailAdapter: {
|
|
202
|
-
isTypeOnly: true;
|
|
203
|
-
};
|
|
204
|
-
EmailAttachment: {
|
|
205
|
-
isTypeOnly: true;
|
|
206
|
-
};
|
|
207
|
-
EmailRawOptions: {
|
|
208
|
-
isTypeOnly: true;
|
|
209
|
-
};
|
|
210
|
-
EmailSendOptions: {
|
|
211
|
-
isTypeOnly: true;
|
|
212
|
-
};
|
|
213
|
-
sendEmail: {};
|
|
214
|
-
sendEmailQueue: {};
|
|
215
|
-
sendRawEmail: {};
|
|
216
|
-
TransformedEmailMessage: {
|
|
217
|
-
isTypeOnly: true;
|
|
218
|
-
};
|
|
219
|
-
}>>;
|
|
220
198
|
errorHandlerServiceImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
|
|
221
199
|
BadRequestError: {};
|
|
222
200
|
ForbiddenError: {};
|
|
@@ -225,6 +203,7 @@ export declare const LOCAL_AUTH_CORE_AUTH_EMAIL_PASSWORD_TEMPLATES: {
|
|
|
225
203
|
InternalServerError: {};
|
|
226
204
|
logError: {};
|
|
227
205
|
NotFoundError: {};
|
|
206
|
+
throwIfPrismaNotFound: {};
|
|
228
207
|
TooManyRequestsError: {};
|
|
229
208
|
UnauthorizedError: {};
|
|
230
209
|
}>>;
|
|
@@ -253,9 +232,13 @@ export declare const LOCAL_AUTH_CORE_AUTH_EMAIL_PASSWORD_TEMPLATES: {
|
|
|
253
232
|
RequestServiceContext: {
|
|
254
233
|
isTypeOnly: true;
|
|
255
234
|
};
|
|
235
|
+
RequestServiceContextWith: {
|
|
236
|
+
isTypeOnly: true;
|
|
237
|
+
};
|
|
256
238
|
}>>;
|
|
257
239
|
}, {
|
|
258
240
|
constantsPassword: {};
|
|
241
|
+
servicesUserPassword: {};
|
|
259
242
|
}>;
|
|
260
243
|
servicesUserPassword: import("@baseplate-dev/core-generators").TsTemplateFile<{
|
|
261
244
|
TPL_NAME_REQUIRED_CHECK: {};
|
|
@@ -268,6 +251,7 @@ export declare const LOCAL_AUTH_CORE_AUTH_EMAIL_PASSWORD_TEMPLATES: {
|
|
|
268
251
|
InternalServerError: {};
|
|
269
252
|
logError: {};
|
|
270
253
|
NotFoundError: {};
|
|
254
|
+
throwIfPrismaNotFound: {};
|
|
271
255
|
TooManyRequestsError: {};
|
|
272
256
|
UnauthorizedError: {};
|
|
273
257
|
}>>;
|
|
@@ -302,9 +286,9 @@ export declare const LOCAL_AUTH_CORE_AUTH_EMAIL_PASSWORD_TEMPLATES: {
|
|
|
302
286
|
RequestServiceContext: {
|
|
303
287
|
isTypeOnly: true;
|
|
304
288
|
};
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
289
|
+
RequestServiceContextWith: {
|
|
290
|
+
isTypeOnly: true;
|
|
291
|
+
};
|
|
308
292
|
}>>;
|
|
309
293
|
userSessionTypesImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
|
|
310
294
|
UserSessionPayload: {
|
|
@@ -330,7 +314,10 @@ export declare const LOCAL_AUTH_CORE_AUTH_EMAIL_PASSWORD_TEMPLATES: {
|
|
|
330
314
|
TPL_ACCOUNT_VERIFICATION_EMAIL: {};
|
|
331
315
|
}, {
|
|
332
316
|
authModuleImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
|
|
317
|
+
cleanupAuthVerificationQueue: {};
|
|
318
|
+
cleanupAuthVerificationWorker: {};
|
|
333
319
|
cleanupExpiredAuthVerifications: {};
|
|
320
|
+
CookieUserSessionService: {};
|
|
334
321
|
createAuthVerification: {};
|
|
335
322
|
userSessionPayload: {};
|
|
336
323
|
validateAuthVerification: {};
|
|
@@ -338,26 +325,6 @@ export declare const LOCAL_AUTH_CORE_AUTH_EMAIL_PASSWORD_TEMPLATES: {
|
|
|
338
325
|
configServiceImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
|
|
339
326
|
config: {};
|
|
340
327
|
}>>;
|
|
341
|
-
emailModuleImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
|
|
342
|
-
EmailAdapter: {
|
|
343
|
-
isTypeOnly: true;
|
|
344
|
-
};
|
|
345
|
-
EmailAttachment: {
|
|
346
|
-
isTypeOnly: true;
|
|
347
|
-
};
|
|
348
|
-
EmailRawOptions: {
|
|
349
|
-
isTypeOnly: true;
|
|
350
|
-
};
|
|
351
|
-
EmailSendOptions: {
|
|
352
|
-
isTypeOnly: true;
|
|
353
|
-
};
|
|
354
|
-
sendEmail: {};
|
|
355
|
-
sendEmailQueue: {};
|
|
356
|
-
sendRawEmail: {};
|
|
357
|
-
TransformedEmailMessage: {
|
|
358
|
-
isTypeOnly: true;
|
|
359
|
-
};
|
|
360
|
-
}>>;
|
|
361
328
|
errorHandlerServiceImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
|
|
362
329
|
BadRequestError: {};
|
|
363
330
|
ForbiddenError: {};
|
|
@@ -366,6 +333,7 @@ export declare const LOCAL_AUTH_CORE_AUTH_EMAIL_PASSWORD_TEMPLATES: {
|
|
|
366
333
|
InternalServerError: {};
|
|
367
334
|
logError: {};
|
|
368
335
|
NotFoundError: {};
|
|
336
|
+
throwIfPrismaNotFound: {};
|
|
369
337
|
TooManyRequestsError: {};
|
|
370
338
|
UnauthorizedError: {};
|
|
371
339
|
}>>;
|
|
@@ -390,6 +358,9 @@ export declare const LOCAL_AUTH_CORE_AUTH_EMAIL_PASSWORD_TEMPLATES: {
|
|
|
390
358
|
RequestServiceContext: {
|
|
391
359
|
isTypeOnly: true;
|
|
392
360
|
};
|
|
361
|
+
RequestServiceContextWith: {
|
|
362
|
+
isTypeOnly: true;
|
|
363
|
+
};
|
|
393
364
|
}>>;
|
|
394
365
|
}, {
|
|
395
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,
|
|
@@ -64,7 +62,10 @@ const servicesPasswordReset = createTsTemplateFile({
|
|
|
64
62
|
requestPasswordReset: { isTypeOnly: false },
|
|
65
63
|
validatePasswordResetToken: { isTypeOnly: false },
|
|
66
64
|
},
|
|
67
|
-
referencedGeneratorTemplates: {
|
|
65
|
+
referencedGeneratorTemplates: {
|
|
66
|
+
constantsPassword: {},
|
|
67
|
+
servicesUserPassword: {},
|
|
68
|
+
},
|
|
68
69
|
source: {
|
|
69
70
|
path: path.join(import.meta.dirname, '../templates/module/services/password-reset.service.ts'),
|
|
70
71
|
},
|
|
@@ -80,7 +81,6 @@ const servicesUserPassword = createTsTemplateFile({
|
|
|
80
81
|
prismaImports: prismaImportsProvider,
|
|
81
82
|
rateLimitImports: rateLimitImportsProvider,
|
|
82
83
|
requestServiceContextImports: requestServiceContextImportsProvider,
|
|
83
|
-
userSessionServiceImports: userSessionServiceImportsProvider,
|
|
84
84
|
userSessionTypesImports: userSessionTypesImportsProvider,
|
|
85
85
|
},
|
|
86
86
|
name: 'services-user-password',
|
|
@@ -120,7 +120,6 @@ const servicesEmailVerification = createTsTemplateFile({
|
|
|
120
120
|
importMapProviders: {
|
|
121
121
|
authModuleImports: authModuleImportsProvider,
|
|
122
122
|
configServiceImports: configServiceImportsProvider,
|
|
123
|
-
emailModuleImports: emailModuleImportsProvider,
|
|
124
123
|
errorHandlerServiceImports: errorHandlerServiceImportsProvider,
|
|
125
124
|
prismaImports: prismaImportsProvider,
|
|
126
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
|
});
|