@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
|
@@ -11,6 +11,9 @@ export interface LocalAuthCoreAuthModuleRenderers {
|
|
|
11
11
|
queuesCleanupAuthVerification: {
|
|
12
12
|
render: (options: Omit<RenderTsTemplateFileActionInput<typeof LOCAL_AUTH_CORE_AUTH_MODULE_TEMPLATES.queuesCleanupAuthVerification>, 'destination' | 'importMapProviders' | 'template' | 'generatorPaths'>) => BuilderAction;
|
|
13
13
|
};
|
|
14
|
+
queuesCleanupAuthVerificationWorker: {
|
|
15
|
+
render: (options: Omit<RenderTsTemplateFileActionInput<typeof LOCAL_AUTH_CORE_AUTH_MODULE_TEMPLATES.queuesCleanupAuthVerificationWorker>, 'destination' | 'importMapProviders' | 'template' | 'generatorPaths'>) => BuilderAction;
|
|
16
|
+
};
|
|
14
17
|
servicesAuthVerification: {
|
|
15
18
|
render: (options: Omit<RenderTsTemplateFileActionInput<typeof LOCAL_AUTH_CORE_AUTH_MODULE_TEMPLATES.servicesAuthVerification>, 'destination' | 'importMapProviders' | 'template' | 'generatorPaths'>) => BuilderAction;
|
|
16
19
|
};
|
|
@@ -63,6 +66,7 @@ export declare const LOCAL_AUTH_CORE_AUTH_MODULE_RENDERERS: {
|
|
|
63
66
|
InternalServerError: {};
|
|
64
67
|
logError: {};
|
|
65
68
|
NotFoundError: {};
|
|
69
|
+
throwIfPrismaNotFound: {};
|
|
66
70
|
TooManyRequestsError: {};
|
|
67
71
|
UnauthorizedError: {};
|
|
68
72
|
}>>;
|
|
@@ -79,14 +83,60 @@ export declare const LOCAL_AUTH_CORE_AUTH_MODULE_RENDERERS: {
|
|
|
79
83
|
prismaImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
|
|
80
84
|
prisma: {};
|
|
81
85
|
}>>;
|
|
82
|
-
|
|
83
|
-
|
|
86
|
+
queuesImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
|
|
87
|
+
bindQueueHandler: {};
|
|
88
|
+
defineQueue: {};
|
|
89
|
+
EnqueueOptions: {
|
|
90
|
+
isTypeOnly: true;
|
|
91
|
+
};
|
|
92
|
+
QueueHandlerBinding: {
|
|
93
|
+
isTypeOnly: true;
|
|
94
|
+
};
|
|
95
|
+
QueueHandlerBindingConfig: {
|
|
96
|
+
isTypeOnly: true;
|
|
97
|
+
};
|
|
98
|
+
QueueHandlerBindingInput: {
|
|
99
|
+
isTypeOnly: true;
|
|
100
|
+
};
|
|
101
|
+
QueueInfo: {
|
|
102
|
+
isTypeOnly: true;
|
|
103
|
+
};
|
|
104
|
+
QueueIntrospection: {
|
|
105
|
+
isTypeOnly: true;
|
|
106
|
+
};
|
|
107
|
+
QueueJob: {
|
|
108
|
+
isTypeOnly: true;
|
|
109
|
+
};
|
|
110
|
+
QueueJobHandler: {
|
|
111
|
+
isTypeOnly: true;
|
|
112
|
+
};
|
|
113
|
+
QueueRuntime: {
|
|
114
|
+
isTypeOnly: true;
|
|
115
|
+
};
|
|
116
|
+
QueueService: {
|
|
117
|
+
isTypeOnly: true;
|
|
118
|
+
};
|
|
119
|
+
QueueToken: {
|
|
120
|
+
isTypeOnly: true;
|
|
121
|
+
};
|
|
122
|
+
QueueWorkers: {
|
|
123
|
+
isTypeOnly: true;
|
|
124
|
+
};
|
|
125
|
+
RepeatableConfig: {
|
|
126
|
+
isTypeOnly: true;
|
|
127
|
+
};
|
|
128
|
+
ScheduledJob: {
|
|
129
|
+
isTypeOnly: true;
|
|
130
|
+
};
|
|
84
131
|
}>>;
|
|
85
132
|
requestServiceContextImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
|
|
86
133
|
createContextFromRequest: {};
|
|
87
134
|
RequestServiceContext: {
|
|
88
135
|
isTypeOnly: true;
|
|
89
136
|
};
|
|
137
|
+
RequestServiceContextWith: {
|
|
138
|
+
isTypeOnly: true;
|
|
139
|
+
};
|
|
90
140
|
}>>;
|
|
91
141
|
typescriptFile: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").TypescriptFileProvider>;
|
|
92
142
|
userSessionTypesImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { typescriptFileProvider } from '@baseplate-dev/core-generators';
|
|
2
2
|
import { authContextImportsProvider, authRolesImportsProvider, configServiceImportsProvider, errorHandlerServiceImportsProvider, pothosImportsProvider, prismaGeneratedImportsProvider, prismaImportsProvider, requestServiceContextImportsProvider, userSessionTypesImportsProvider, } from '@baseplate-dev/fastify-generators';
|
|
3
|
-
import {
|
|
3
|
+
import { queuesImportsProvider } from '@baseplate-dev/plugin-queue';
|
|
4
4
|
import { createGeneratorTask, createProviderType } from '@baseplate-dev/sync';
|
|
5
5
|
import { LOCAL_AUTH_CORE_AUTH_MODULE_PATHS } from './template-paths.js';
|
|
6
6
|
import { LOCAL_AUTH_CORE_AUTH_MODULE_TEMPLATES } from './typed-templates.js';
|
|
@@ -15,7 +15,7 @@ const localAuthCoreAuthModuleRenderersTask = createGeneratorTask({
|
|
|
15
15
|
pothosImports: pothosImportsProvider,
|
|
16
16
|
prismaGeneratedImports: prismaGeneratedImportsProvider,
|
|
17
17
|
prismaImports: prismaImportsProvider,
|
|
18
|
-
|
|
18
|
+
queuesImports: queuesImportsProvider,
|
|
19
19
|
requestServiceContextImports: requestServiceContextImportsProvider,
|
|
20
20
|
typescriptFile: typescriptFileProvider,
|
|
21
21
|
userSessionTypesImports: userSessionTypesImportsProvider,
|
|
@@ -23,7 +23,7 @@ const localAuthCoreAuthModuleRenderersTask = createGeneratorTask({
|
|
|
23
23
|
exports: {
|
|
24
24
|
localAuthCoreAuthModuleRenderers: localAuthCoreAuthModuleRenderers.export(),
|
|
25
25
|
},
|
|
26
|
-
run({ authContextImports, authRolesImports, configServiceImports, errorHandlerServiceImports, paths, pothosImports, prismaGeneratedImports, prismaImports,
|
|
26
|
+
run({ authContextImports, authRolesImports, configServiceImports, errorHandlerServiceImports, paths, pothosImports, prismaGeneratedImports, prismaImports, queuesImports, requestServiceContextImports, typescriptFile, userSessionTypesImports, }) {
|
|
27
27
|
return {
|
|
28
28
|
providers: {
|
|
29
29
|
localAuthCoreAuthModuleRenderers: {
|
|
@@ -54,7 +54,17 @@ const localAuthCoreAuthModuleRenderersTask = createGeneratorTask({
|
|
|
54
54
|
template: LOCAL_AUTH_CORE_AUTH_MODULE_TEMPLATES.queuesCleanupAuthVerification,
|
|
55
55
|
destination: paths.queuesCleanupAuthVerification,
|
|
56
56
|
importMapProviders: {
|
|
57
|
-
|
|
57
|
+
queuesImports,
|
|
58
|
+
},
|
|
59
|
+
...options,
|
|
60
|
+
}),
|
|
61
|
+
},
|
|
62
|
+
queuesCleanupAuthVerificationWorker: {
|
|
63
|
+
render: (options) => typescriptFile.renderTemplateFile({
|
|
64
|
+
template: LOCAL_AUTH_CORE_AUTH_MODULE_TEMPLATES.queuesCleanupAuthVerificationWorker,
|
|
65
|
+
destination: paths.queuesCleanupAuthVerificationWorker,
|
|
66
|
+
importMapProviders: {
|
|
67
|
+
queuesImports,
|
|
58
68
|
},
|
|
59
69
|
generatorPaths: paths,
|
|
60
70
|
...options,
|
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
import type { TsImportMapProviderFromSchema } from '@baseplate-dev/core-generators';
|
|
2
2
|
export declare const authModuleImportsSchema: {
|
|
3
|
+
cleanupAuthVerificationQueue: {};
|
|
4
|
+
cleanupAuthVerificationWorker: {};
|
|
3
5
|
cleanupExpiredAuthVerifications: {};
|
|
6
|
+
CookieUserSessionService: {};
|
|
4
7
|
createAuthVerification: {};
|
|
5
8
|
userSessionPayload: {};
|
|
6
9
|
validateAuthVerification: {};
|
|
7
10
|
};
|
|
8
11
|
export type AuthModuleImportsProvider = TsImportMapProviderFromSchema<typeof authModuleImportsSchema>;
|
|
9
12
|
export declare const authModuleImportsProvider: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
|
|
13
|
+
cleanupAuthVerificationQueue: {};
|
|
14
|
+
cleanupAuthVerificationWorker: {};
|
|
10
15
|
cleanupExpiredAuthVerifications: {};
|
|
16
|
+
CookieUserSessionService: {};
|
|
11
17
|
createAuthVerification: {};
|
|
12
18
|
userSessionPayload: {};
|
|
13
19
|
validateAuthVerification: {};
|
|
@@ -15,14 +21,14 @@ export declare const authModuleImportsProvider: import("@baseplate-dev/sync").Pr
|
|
|
15
21
|
export declare const LOCAL_AUTH_CORE_AUTH_MODULE_IMPORTS: {
|
|
16
22
|
task: import("@baseplate-dev/sync").GeneratorTask<{
|
|
17
23
|
authModuleImports: import("@baseplate-dev/sync").ProviderExport<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
|
|
24
|
+
cleanupAuthVerificationQueue: {};
|
|
25
|
+
cleanupAuthVerificationWorker: {};
|
|
18
26
|
cleanupExpiredAuthVerifications: {};
|
|
27
|
+
CookieUserSessionService: {};
|
|
19
28
|
createAuthVerification: {};
|
|
20
29
|
userSessionPayload: {};
|
|
21
30
|
validateAuthVerification: {};
|
|
22
31
|
}>>;
|
|
23
|
-
userSessionServiceImports: import("@baseplate-dev/sync").ProviderExport<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
|
|
24
|
-
userSessionService: {};
|
|
25
|
-
}>>;
|
|
26
32
|
}, {
|
|
27
33
|
paths: import("@baseplate-dev/sync").ProviderType<import("./template-paths.js").LocalAuthCoreAuthModulePaths>;
|
|
28
34
|
}, undefined>;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { createTsImportMap, createTsImportMapSchema, packageScope, } from '@baseplate-dev/core-generators';
|
|
2
|
-
import { userSessionServiceImportsProvider, userSessionServiceImportsSchema, } from '@baseplate-dev/fastify-generators';
|
|
3
2
|
import { createGeneratorTask, createReadOnlyProviderType, } from '@baseplate-dev/sync';
|
|
4
3
|
import { LOCAL_AUTH_CORE_AUTH_MODULE_PATHS } from './template-paths.js';
|
|
5
4
|
export const authModuleImportsSchema = createTsImportMapSchema({
|
|
5
|
+
cleanupAuthVerificationQueue: {},
|
|
6
|
+
cleanupAuthVerificationWorker: {},
|
|
6
7
|
cleanupExpiredAuthVerifications: {},
|
|
8
|
+
CookieUserSessionService: {},
|
|
7
9
|
createAuthVerification: {},
|
|
8
10
|
userSessionPayload: {},
|
|
9
11
|
validateAuthVerification: {},
|
|
@@ -15,18 +17,19 @@ const localAuthCoreAuthModuleImportsTask = createGeneratorTask({
|
|
|
15
17
|
},
|
|
16
18
|
exports: {
|
|
17
19
|
authModuleImports: authModuleImportsProvider.export(packageScope),
|
|
18
|
-
userSessionServiceImports: userSessionServiceImportsProvider.export(packageScope),
|
|
19
20
|
},
|
|
20
21
|
run({ paths }) {
|
|
21
22
|
return {
|
|
22
23
|
providers: {
|
|
23
24
|
authModuleImports: createTsImportMap(authModuleImportsSchema, {
|
|
25
|
+
cleanupAuthVerificationQueue: paths.queuesCleanupAuthVerification,
|
|
26
|
+
cleanupAuthVerificationWorker: paths.queuesCleanupAuthVerificationWorker,
|
|
24
27
|
cleanupExpiredAuthVerifications: paths.servicesAuthVerification,
|
|
28
|
+
CookieUserSessionService: paths.userSessionService,
|
|
25
29
|
createAuthVerification: paths.servicesAuthVerification,
|
|
26
30
|
userSessionPayload: paths.schemaUserSessionPayloadObjectType,
|
|
27
31
|
validateAuthVerification: paths.servicesAuthVerification,
|
|
28
32
|
}),
|
|
29
|
-
userSessionServiceImports: createTsImportMap(userSessionServiceImportsSchema, { userSessionService: paths.userSessionService }),
|
|
30
33
|
},
|
|
31
34
|
};
|
|
32
35
|
},
|
|
@@ -22,9 +22,7 @@ export declare const moduleGroup: {
|
|
|
22
22
|
pothosImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
|
|
23
23
|
builder: {};
|
|
24
24
|
}>>;
|
|
25
|
-
},
|
|
26
|
-
userSessionService: {};
|
|
27
|
-
}>;
|
|
25
|
+
}, Record<never, Record<never, never>>>;
|
|
28
26
|
schemaUserSessionPayloadObjectType: import("@baseplate-dev/core-generators").TsTemplateFile<{
|
|
29
27
|
TPL_PRISMA_USER: {};
|
|
30
28
|
TPL_USER_OBJECT_TYPE: {};
|
|
@@ -77,6 +75,7 @@ export declare const moduleGroup: {
|
|
|
77
75
|
InternalServerError: {};
|
|
78
76
|
logError: {};
|
|
79
77
|
NotFoundError: {};
|
|
78
|
+
throwIfPrismaNotFound: {};
|
|
80
79
|
TooManyRequestsError: {};
|
|
81
80
|
UnauthorizedError: {};
|
|
82
81
|
}>>;
|
|
@@ -125,9 +124,7 @@ export declare const LOCAL_AUTH_CORE_AUTH_MODULE_TEMPLATES: {
|
|
|
125
124
|
pothosImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
|
|
126
125
|
builder: {};
|
|
127
126
|
}>>;
|
|
128
|
-
},
|
|
129
|
-
userSessionService: {};
|
|
130
|
-
}>;
|
|
127
|
+
}, Record<never, Record<never, never>>>;
|
|
131
128
|
schemaUserSessionPayloadObjectType: import("@baseplate-dev/core-generators").TsTemplateFile<{
|
|
132
129
|
TPL_PRISMA_USER: {};
|
|
133
130
|
TPL_USER_OBJECT_TYPE: {};
|
|
@@ -180,6 +177,7 @@ export declare const LOCAL_AUTH_CORE_AUTH_MODULE_TEMPLATES: {
|
|
|
180
177
|
InternalServerError: {};
|
|
181
178
|
logError: {};
|
|
182
179
|
NotFoundError: {};
|
|
180
|
+
throwIfPrismaNotFound: {};
|
|
183
181
|
TooManyRequestsError: {};
|
|
184
182
|
UnauthorizedError: {};
|
|
185
183
|
}>>;
|
|
@@ -195,10 +193,102 @@ export declare const LOCAL_AUTH_CORE_AUTH_MODULE_TEMPLATES: {
|
|
|
195
193
|
}, Record<never, Record<never, never>>>;
|
|
196
194
|
};
|
|
197
195
|
queuesCleanupAuthVerification: import("@baseplate-dev/core-generators").TsTemplateFile<{}, {
|
|
198
|
-
|
|
199
|
-
|
|
196
|
+
queuesImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
|
|
197
|
+
bindQueueHandler: {};
|
|
198
|
+
defineQueue: {};
|
|
199
|
+
EnqueueOptions: {
|
|
200
|
+
isTypeOnly: true;
|
|
201
|
+
};
|
|
202
|
+
QueueHandlerBinding: {
|
|
203
|
+
isTypeOnly: true;
|
|
204
|
+
};
|
|
205
|
+
QueueHandlerBindingConfig: {
|
|
206
|
+
isTypeOnly: true;
|
|
207
|
+
};
|
|
208
|
+
QueueHandlerBindingInput: {
|
|
209
|
+
isTypeOnly: true;
|
|
210
|
+
};
|
|
211
|
+
QueueInfo: {
|
|
212
|
+
isTypeOnly: true;
|
|
213
|
+
};
|
|
214
|
+
QueueIntrospection: {
|
|
215
|
+
isTypeOnly: true;
|
|
216
|
+
};
|
|
217
|
+
QueueJob: {
|
|
218
|
+
isTypeOnly: true;
|
|
219
|
+
};
|
|
220
|
+
QueueJobHandler: {
|
|
221
|
+
isTypeOnly: true;
|
|
222
|
+
};
|
|
223
|
+
QueueRuntime: {
|
|
224
|
+
isTypeOnly: true;
|
|
225
|
+
};
|
|
226
|
+
QueueService: {
|
|
227
|
+
isTypeOnly: true;
|
|
228
|
+
};
|
|
229
|
+
QueueToken: {
|
|
230
|
+
isTypeOnly: true;
|
|
231
|
+
};
|
|
232
|
+
QueueWorkers: {
|
|
233
|
+
isTypeOnly: true;
|
|
234
|
+
};
|
|
235
|
+
RepeatableConfig: {
|
|
236
|
+
isTypeOnly: true;
|
|
237
|
+
};
|
|
238
|
+
ScheduledJob: {
|
|
239
|
+
isTypeOnly: true;
|
|
240
|
+
};
|
|
241
|
+
}>>;
|
|
242
|
+
}, Record<never, Record<never, never>>>;
|
|
243
|
+
queuesCleanupAuthVerificationWorker: import("@baseplate-dev/core-generators").TsTemplateFile<{}, {
|
|
244
|
+
queuesImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
|
|
245
|
+
bindQueueHandler: {};
|
|
246
|
+
defineQueue: {};
|
|
247
|
+
EnqueueOptions: {
|
|
248
|
+
isTypeOnly: true;
|
|
249
|
+
};
|
|
250
|
+
QueueHandlerBinding: {
|
|
251
|
+
isTypeOnly: true;
|
|
252
|
+
};
|
|
253
|
+
QueueHandlerBindingConfig: {
|
|
254
|
+
isTypeOnly: true;
|
|
255
|
+
};
|
|
256
|
+
QueueHandlerBindingInput: {
|
|
257
|
+
isTypeOnly: true;
|
|
258
|
+
};
|
|
259
|
+
QueueInfo: {
|
|
260
|
+
isTypeOnly: true;
|
|
261
|
+
};
|
|
262
|
+
QueueIntrospection: {
|
|
263
|
+
isTypeOnly: true;
|
|
264
|
+
};
|
|
265
|
+
QueueJob: {
|
|
266
|
+
isTypeOnly: true;
|
|
267
|
+
};
|
|
268
|
+
QueueJobHandler: {
|
|
269
|
+
isTypeOnly: true;
|
|
270
|
+
};
|
|
271
|
+
QueueRuntime: {
|
|
272
|
+
isTypeOnly: true;
|
|
273
|
+
};
|
|
274
|
+
QueueService: {
|
|
275
|
+
isTypeOnly: true;
|
|
276
|
+
};
|
|
277
|
+
QueueToken: {
|
|
278
|
+
isTypeOnly: true;
|
|
279
|
+
};
|
|
280
|
+
QueueWorkers: {
|
|
281
|
+
isTypeOnly: true;
|
|
282
|
+
};
|
|
283
|
+
RepeatableConfig: {
|
|
284
|
+
isTypeOnly: true;
|
|
285
|
+
};
|
|
286
|
+
ScheduledJob: {
|
|
287
|
+
isTypeOnly: true;
|
|
288
|
+
};
|
|
200
289
|
}>>;
|
|
201
290
|
}, {
|
|
291
|
+
queuesCleanupAuthVerification: {};
|
|
202
292
|
servicesAuthVerification: {};
|
|
203
293
|
}>;
|
|
204
294
|
servicesAuthVerification: import("@baseplate-dev/core-generators").TsTemplateFile<{}, {
|
|
@@ -252,6 +342,7 @@ export declare const LOCAL_AUTH_CORE_AUTH_MODULE_TEMPLATES: {
|
|
|
252
342
|
InternalServerError: {};
|
|
253
343
|
logError: {};
|
|
254
344
|
NotFoundError: {};
|
|
345
|
+
throwIfPrismaNotFound: {};
|
|
255
346
|
TooManyRequestsError: {};
|
|
256
347
|
UnauthorizedError: {};
|
|
257
348
|
}>>;
|
|
@@ -263,6 +354,9 @@ export declare const LOCAL_AUTH_CORE_AUTH_MODULE_TEMPLATES: {
|
|
|
263
354
|
RequestServiceContext: {
|
|
264
355
|
isTypeOnly: true;
|
|
265
356
|
};
|
|
357
|
+
RequestServiceContextWith: {
|
|
358
|
+
isTypeOnly: true;
|
|
359
|
+
};
|
|
266
360
|
}>>;
|
|
267
361
|
userSessionTypesImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
|
|
268
362
|
UserSessionPayload: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createTsTemplateFile } from '@baseplate-dev/core-generators';
|
|
2
2
|
import { authContextImportsProvider, authRolesImportsProvider, configServiceImportsProvider, errorHandlerServiceImportsProvider, pothosImportsProvider, prismaGeneratedImportsProvider, prismaImportsProvider, requestServiceContextImportsProvider, userSessionTypesImportsProvider, } from '@baseplate-dev/fastify-generators';
|
|
3
|
-
import {
|
|
3
|
+
import { queuesImportsProvider } from '@baseplate-dev/plugin-queue';
|
|
4
4
|
import path from 'node:path';
|
|
5
5
|
const userSessionConstants = createTsTemplateFile({
|
|
6
6
|
fileOptions: { kind: 'singleton' },
|
|
@@ -32,7 +32,6 @@ const schemaUserSessionMutations = createTsTemplateFile({
|
|
|
32
32
|
group: 'module',
|
|
33
33
|
importMapProviders: { pothosImports: pothosImportsProvider },
|
|
34
34
|
name: 'schema-user-session-mutations',
|
|
35
|
-
referencedGeneratorTemplates: { userSessionService: {} },
|
|
36
35
|
source: {
|
|
37
36
|
path: path.join(import.meta.dirname, '../templates/module/schema/user-session.mutations.ts'),
|
|
38
37
|
},
|
|
@@ -102,14 +101,28 @@ export const moduleGroup = {
|
|
|
102
101
|
};
|
|
103
102
|
const queuesCleanupAuthVerification = createTsTemplateFile({
|
|
104
103
|
fileOptions: { kind: 'singleton' },
|
|
105
|
-
importMapProviders: {
|
|
104
|
+
importMapProviders: { queuesImports: queuesImportsProvider },
|
|
106
105
|
name: 'queues-cleanup-auth-verification',
|
|
107
|
-
|
|
106
|
+
projectExports: { cleanupAuthVerificationQueue: { isTypeOnly: false } },
|
|
108
107
|
source: {
|
|
109
108
|
path: path.join(import.meta.dirname, '../templates/module/queues/cleanup-auth-verification.queue.ts'),
|
|
110
109
|
},
|
|
111
110
|
variables: {},
|
|
112
111
|
});
|
|
112
|
+
const queuesCleanupAuthVerificationWorker = createTsTemplateFile({
|
|
113
|
+
fileOptions: { kind: 'singleton' },
|
|
114
|
+
importMapProviders: { queuesImports: queuesImportsProvider },
|
|
115
|
+
name: 'queues-cleanup-auth-verification-worker',
|
|
116
|
+
projectExports: { cleanupAuthVerificationWorker: { isTypeOnly: false } },
|
|
117
|
+
referencedGeneratorTemplates: {
|
|
118
|
+
queuesCleanupAuthVerification: {},
|
|
119
|
+
servicesAuthVerification: {},
|
|
120
|
+
},
|
|
121
|
+
source: {
|
|
122
|
+
path: path.join(import.meta.dirname, '../templates/module/queues/cleanup-auth-verification.worker.ts'),
|
|
123
|
+
},
|
|
124
|
+
variables: {},
|
|
125
|
+
});
|
|
113
126
|
const servicesAuthVerification = createTsTemplateFile({
|
|
114
127
|
fileOptions: { kind: 'singleton' },
|
|
115
128
|
importMapProviders: {
|
|
@@ -139,7 +152,7 @@ const userSessionService = createTsTemplateFile({
|
|
|
139
152
|
userSessionTypesImports: userSessionTypesImportsProvider,
|
|
140
153
|
},
|
|
141
154
|
name: 'user-session-service',
|
|
142
|
-
projectExports: {
|
|
155
|
+
projectExports: { CookieUserSessionService: { isTypeOnly: false } },
|
|
143
156
|
referencedGeneratorTemplates: {
|
|
144
157
|
cookieSigner: {},
|
|
145
158
|
sessionCookie: {},
|
|
@@ -186,6 +199,7 @@ export const LOCAL_AUTH_CORE_AUTH_MODULE_TEMPLATES = {
|
|
|
186
199
|
constantsGroup,
|
|
187
200
|
moduleGroup,
|
|
188
201
|
queuesCleanupAuthVerification,
|
|
202
|
+
queuesCleanupAuthVerificationWorker,
|
|
189
203
|
servicesAuthVerification,
|
|
190
204
|
userSessionService,
|
|
191
205
|
utilsGroup,
|
|
@@ -1,17 +1,4 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Periodic queue to clean up expired auth verification tokens.
|
|
6
|
-
* Runs hourly to maintain database hygiene.
|
|
7
|
-
*/
|
|
8
|
-
export const cleanupAuthVerificationQueue = createQueue('cleanup-auth-verification', {
|
|
9
|
-
handler: async () => {
|
|
10
|
-
const result = await cleanupExpiredAuthVerifications();
|
|
11
|
-
return { deletedCount: result.deletedCount };
|
|
12
|
-
},
|
|
13
|
-
repeatable: {
|
|
14
|
-
pattern: '15 * * * *', // Every hour at minute 15
|
|
15
|
-
},
|
|
16
|
-
});
|
|
2
|
+
import { defineQueue } from '%queuesImports';
|
|
3
|
+
export const cleanupAuthVerificationQueue = defineQueue('cleanup-auth-verification');
|
|
17
4
|
//# sourceMappingURL=cleanup-auth-verification.queue.js.map
|
|
@@ -1,21 +1,7 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import { createQueue } from '%queueServiceImports';
|
|
3
|
+
import { defineQueue } from '%queuesImports';
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
* Periodic queue to clean up expired auth verification tokens.
|
|
8
|
-
* Runs hourly to maintain database hygiene.
|
|
9
|
-
*/
|
|
10
|
-
export const cleanupAuthVerificationQueue = createQueue(
|
|
5
|
+
export const cleanupAuthVerificationQueue = defineQueue<undefined>(
|
|
11
6
|
'cleanup-auth-verification',
|
|
12
|
-
{
|
|
13
|
-
handler: async () => {
|
|
14
|
-
const result = await cleanupExpiredAuthVerifications();
|
|
15
|
-
return { deletedCount: result.deletedCount };
|
|
16
|
-
},
|
|
17
|
-
repeatable: {
|
|
18
|
-
pattern: '15 * * * *', // Every hour at minute 15
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
7
|
);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
import { cleanupAuthVerificationQueue } from '$queuesCleanupAuthVerification';
|
|
3
|
+
import { cleanupExpiredAuthVerifications } from '$servicesAuthVerification';
|
|
4
|
+
import { bindQueueHandler } from '%queuesImports';
|
|
5
|
+
/**
|
|
6
|
+
* Periodic worker to clean up expired auth verification tokens.
|
|
7
|
+
* Runs hourly to maintain database hygiene.
|
|
8
|
+
*/
|
|
9
|
+
export const cleanupAuthVerificationWorker = bindQueueHandler(cleanupAuthVerificationQueue, {
|
|
10
|
+
handler: async () => {
|
|
11
|
+
const result = await cleanupExpiredAuthVerifications();
|
|
12
|
+
return { deletedCount: result.deletedCount };
|
|
13
|
+
},
|
|
14
|
+
repeatable: {
|
|
15
|
+
pattern: '15 * * * *', // Every hour at minute 15
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
//# sourceMappingURL=cleanup-auth-verification.worker.js.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
|
|
3
|
+
import { cleanupAuthVerificationQueue } from '$queuesCleanupAuthVerification';
|
|
4
|
+
import { cleanupExpiredAuthVerifications } from '$servicesAuthVerification';
|
|
5
|
+
import { bindQueueHandler } from '%queuesImports';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Periodic worker to clean up expired auth verification tokens.
|
|
9
|
+
* Runs hourly to maintain database hygiene.
|
|
10
|
+
*/
|
|
11
|
+
export const cleanupAuthVerificationWorker = bindQueueHandler(
|
|
12
|
+
cleanupAuthVerificationQueue,
|
|
13
|
+
{
|
|
14
|
+
handler: async () => {
|
|
15
|
+
const result = await cleanupExpiredAuthVerifications();
|
|
16
|
+
return { deletedCount: result.deletedCount };
|
|
17
|
+
},
|
|
18
|
+
repeatable: {
|
|
19
|
+
pattern: '15 * * * *', // Every hour at minute 15
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
);
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
|
-
import { userSessionService } from '$userSessionService';
|
|
3
2
|
import { builder } from '%pothosImports';
|
|
4
3
|
builder.mutationField('logOut', (t) => t.fieldWithInputPayload({
|
|
5
4
|
authorize: ['public'],
|
|
@@ -10,7 +9,7 @@ builder.mutationField('logOut', (t) => t.fieldWithInputPayload({
|
|
|
10
9
|
},
|
|
11
10
|
resolve: async (parent, args, context) => {
|
|
12
11
|
if (context.auth.session?.type === 'user') {
|
|
13
|
-
await
|
|
12
|
+
await context.services.userSession.clearSession(context.auth.session, context);
|
|
14
13
|
}
|
|
15
14
|
return { success: true };
|
|
16
15
|
},
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
2
|
|
|
3
|
-
import { userSessionService } from '$userSessionService';
|
|
4
3
|
import { builder } from '%pothosImports';
|
|
5
4
|
|
|
6
5
|
builder.mutationField('logOut', (t) =>
|
|
@@ -13,7 +12,10 @@ builder.mutationField('logOut', (t) =>
|
|
|
13
12
|
},
|
|
14
13
|
resolve: async (parent, args, context) => {
|
|
15
14
|
if (context.auth.session?.type === 'user') {
|
|
16
|
-
await
|
|
15
|
+
await context.services.userSession.clearSession(
|
|
16
|
+
context.auth.session,
|
|
17
|
+
context,
|
|
18
|
+
);
|
|
17
19
|
}
|
|
18
20
|
|
|
19
21
|
return { success: true };
|
|
@@ -39,5 +39,4 @@ export declare class CookieUserSessionService implements UserSessionService {
|
|
|
39
39
|
*/
|
|
40
40
|
getSessionInfoFromToken(req: FastifyRequest): Promise<AuthUserSessionInfo | undefined>;
|
|
41
41
|
}
|
|
42
|
-
export declare const userSessionService: CookieUserSessionService;
|
|
43
42
|
//# sourceMappingURL=user-session.service.d.ts.map
|
|
@@ -14,6 +14,8 @@ export declare const authRoutesGenerator: import("@baseplate-dev/sync").Generato
|
|
|
14
14
|
}, {
|
|
15
15
|
apolloErrorImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
|
|
16
16
|
getApolloErrorCode: {};
|
|
17
|
+
getApolloErrorData: {};
|
|
18
|
+
getApolloErrorDetails: {};
|
|
17
19
|
}>>;
|
|
18
20
|
graphqlImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
|
|
19
21
|
'*': {};
|
|
@@ -112,6 +114,13 @@ export declare const authRoutesGenerator: import("@baseplate-dev/sync").Generato
|
|
|
112
114
|
DropdownMenuSubContent: {};
|
|
113
115
|
DropdownMenuSubTrigger: {};
|
|
114
116
|
DropdownMenuTrigger: {};
|
|
117
|
+
Empty: {};
|
|
118
|
+
EmptyContent: {};
|
|
119
|
+
EmptyDescription: {};
|
|
120
|
+
EmptyHeader: {};
|
|
121
|
+
EmptyMedia: {};
|
|
122
|
+
emptyMediaVariants: {};
|
|
123
|
+
EmptyTitle: {};
|
|
115
124
|
ErrorableLoader: {};
|
|
116
125
|
ErrorDisplay: {};
|
|
117
126
|
Field: {};
|