@baseplate-dev/plugin-auth 0.6.17 → 0.6.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (294) hide show
  1. package/CHANGELOG.md +54 -0
  2. package/dist/better-auth/admin/generators/admin-crud-manage-roles-action/admin-crud-manage-roles-action.generator.d.ts +74 -0
  3. package/dist/better-auth/admin/generators/admin-crud-manage-roles-action/generated/index.d.ts +74 -0
  4. package/dist/better-auth/admin/generators/admin-crud-manage-roles-action/generated/template-renderers.d.ts +37 -0
  5. package/dist/better-auth/admin/generators/admin-crud-manage-roles-action/generated/typed-templates.d.ts +37 -0
  6. package/dist/better-auth/admin/generators/admin-crud-manage-roles-action/templates/routes/-components/role-manager-dialog.js +1 -2
  7. package/dist/better-auth/admin/generators/admin-crud-manage-roles-action/templates/routes/-components/role-manager-dialog.tsx +1 -1
  8. package/dist/better-auth/admin/generators/admin-crud-reset-password-action/admin-crud-reset-password-action.generator.d.ts +74 -0
  9. package/dist/better-auth/admin/generators/admin-crud-reset-password-action/generated/index.d.ts +74 -0
  10. package/dist/better-auth/admin/generators/admin-crud-reset-password-action/generated/template-renderers.d.ts +37 -0
  11. package/dist/better-auth/admin/generators/admin-crud-reset-password-action/generated/typed-templates.d.ts +74 -0
  12. package/dist/better-auth/admin/generators/admin-crud-reset-password-action/templates/routes/-components/password-reset-dialog.js +1 -2
  13. package/dist/better-auth/admin/generators/admin-crud-reset-password-action/templates/routes/-components/password-reset-dialog.tsx +1 -1
  14. package/dist/better-auth/admin/generators/admin-crud-roles-column/admin-crud-roles-column.generator.d.ts +37 -0
  15. package/dist/better-auth/core/node.js +7 -8
  16. package/dist/better-auth/generators/fastify/better-auth-admin-module/generated/index.d.ts +1 -0
  17. package/dist/better-auth/generators/fastify/better-auth-admin-module/generated/ts-import-providers.d.ts +1 -0
  18. package/dist/better-auth/generators/fastify/better-auth-admin-module/generated/ts-import-providers.js +1 -0
  19. package/dist/better-auth/generators/fastify/better-auth-module/better-auth-module.generator.d.ts +20 -3
  20. package/dist/better-auth/generators/fastify/better-auth-module/better-auth-module.generator.js +5 -24
  21. package/dist/better-auth/generators/fastify/better-auth-module/generated/index.d.ts +40 -2
  22. package/dist/better-auth/generators/fastify/better-auth-module/generated/template-renderers.d.ts +19 -1
  23. package/dist/better-auth/generators/fastify/better-auth-module/generated/template-renderers.js +6 -2
  24. package/dist/better-auth/generators/fastify/better-auth-module/generated/ts-import-providers.d.ts +1 -0
  25. package/dist/better-auth/generators/fastify/better-auth-module/generated/ts-import-providers.js +1 -0
  26. package/dist/better-auth/generators/fastify/better-auth-module/generated/typed-templates.d.ts +20 -1
  27. package/dist/better-auth/generators/fastify/better-auth-module/generated/typed-templates.js +4 -1
  28. package/dist/better-auth/generators/fastify/better-auth-module/templates/module/services/auth.ts +16 -8
  29. package/dist/better-auth/generators/react/better-auth-hooks/better-auth-hooks.generator.d.ts +1 -1
  30. package/dist/better-auth/generators/react/better-auth-hooks/generated/index.d.ts +5 -4
  31. package/dist/better-auth/generators/react/better-auth-hooks/generated/template-paths.d.ts +1 -1
  32. package/dist/better-auth/generators/react/better-auth-hooks/generated/template-paths.js +1 -1
  33. package/dist/better-auth/generators/react/better-auth-hooks/generated/ts-import-providers.d.ts +2 -1
  34. package/dist/better-auth/generators/react/better-auth-hooks/generated/ts-import-providers.js +2 -1
  35. package/dist/better-auth/generators/react/better-auth-hooks/generated/typed-templates.d.ts +6 -6
  36. package/dist/better-auth/generators/react/better-auth-hooks/generated/typed-templates.js +13 -13
  37. package/dist/better-auth/generators/react/better-auth-hooks/templates/src/hooks/{use-required-user-id.ts → use-user-id-or-throw.ts} +1 -1
  38. package/dist/better-auth/generators/react/better-auth-pages/better-auth-pages.generator.d.ts +37 -0
  39. package/dist/better-auth/generators/react/better-auth-pages/generated/index.d.ts +222 -0
  40. package/dist/better-auth/generators/react/better-auth-pages/generated/template-renderers.d.ts +37 -0
  41. package/dist/better-auth/generators/react/better-auth-pages/generated/typed-templates.d.ts +370 -0
  42. package/dist/better-auth/generators/react/better-auth-pages/templates/routes/forgot-password.tsx +1 -4
  43. package/dist/better-auth/generators/react/react-better-auth/generated/index.d.ts +77 -2
  44. package/dist/better-auth/generators/react/react-better-auth/generated/template-renderers.d.ts +38 -1
  45. package/dist/better-auth/generators/react/react-better-auth/generated/ts-import-providers.d.ts +1 -0
  46. package/dist/better-auth/generators/react/react-better-auth/generated/ts-import-providers.js +1 -0
  47. package/dist/better-auth/generators/react/react-better-auth/generated/typed-templates.d.ts +38 -1
  48. package/dist/better-auth/generators/react/react-better-auth/react-better-auth.generator.d.ts +38 -1
  49. package/dist/better-auth/generators/react/react-better-auth/templates/src/app/auth-loaded-gate.tsx +12 -3
  50. package/dist/local-auth/admin/common.js +6 -0
  51. package/dist/local-auth/admin/generators/admin-crud-invite-user-action/admin-crud-invite-user-action.generator.d.ts +593 -0
  52. package/dist/local-auth/admin/generators/admin-crud-invite-user-action/admin-crud-invite-user-action.generator.js +119 -0
  53. package/dist/local-auth/admin/generators/admin-crud-invite-user-action/generated/index.d.ts +602 -0
  54. package/dist/local-auth/admin/generators/admin-crud-invite-user-action/generated/index.js +11 -0
  55. package/dist/local-auth/admin/generators/admin-crud-invite-user-action/generated/template-paths.d.ts +12 -0
  56. package/dist/local-auth/admin/generators/admin-crud-invite-user-action/generated/template-paths.js +24 -0
  57. package/dist/local-auth/admin/generators/admin-crud-invite-user-action/generated/template-renderers.d.ts +307 -0
  58. package/dist/local-auth/admin/generators/admin-crud-invite-user-action/generated/template-renderers.js +45 -0
  59. package/dist/local-auth/admin/generators/admin-crud-invite-user-action/generated/typed-templates.d.ts +294 -0
  60. package/dist/local-auth/admin/generators/admin-crud-invite-user-action/generated/typed-templates.js +21 -0
  61. package/dist/local-auth/admin/generators/admin-crud-invite-user-action/index.d.ts +2 -0
  62. package/dist/local-auth/admin/generators/admin-crud-invite-user-action/index.js +2 -0
  63. package/dist/local-auth/admin/generators/admin-crud-invite-user-action/templates/routes/-components/invite-user-dialog.d.ts +21 -0
  64. package/dist/local-auth/admin/generators/admin-crud-invite-user-action/templates/routes/-components/invite-user-dialog.js +68 -0
  65. package/dist/local-auth/admin/generators/admin-crud-invite-user-action/templates/routes/-components/invite-user-dialog.tsx +122 -0
  66. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/admin-crud-manage-roles-action.generator.d.ts +74 -0
  67. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/index.d.ts +74 -0
  68. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/template-renderers.d.ts +37 -0
  69. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/typed-templates.d.ts +37 -0
  70. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/templates/routes/-components/role-manager-dialog.js +1 -2
  71. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/templates/routes/-components/role-manager-dialog.tsx +1 -1
  72. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/admin-crud-reset-password-action.generator.d.ts +74 -0
  73. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/index.d.ts +74 -0
  74. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/template-renderers.d.ts +37 -0
  75. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/typed-templates.d.ts +74 -0
  76. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/templates/routes/-components/password-reset-dialog.js +1 -2
  77. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/templates/routes/-components/password-reset-dialog.tsx +1 -1
  78. package/dist/local-auth/admin/generators/admin-crud-roles-column/admin-crud-roles-column.generator.d.ts +37 -0
  79. package/dist/local-auth/admin/node.js +13 -0
  80. package/dist/local-auth/admin/schema/invite-user-action.d.ts +12 -0
  81. package/dist/local-auth/admin/schema/invite-user-action.js +6 -0
  82. package/dist/local-auth/admin/web.js +8 -0
  83. package/dist/local-auth/core/common.js +7 -2
  84. package/dist/local-auth/core/components/local-auth-definition-editor.js +2 -1
  85. package/dist/local-auth/core/components/local-auth-web-app-settings-form.d.ts +9 -0
  86. package/dist/local-auth/core/components/local-auth-web-app-settings-form.js +11 -0
  87. package/dist/local-auth/core/generators/auth-email-password/auth-email-password.generator.d.ts +16 -7
  88. package/dist/local-auth/core/generators/auth-email-password/auth-email-password.generator.js +73 -16
  89. package/dist/local-auth/core/generators/auth-email-password/generated/index.d.ts +222 -7
  90. package/dist/local-auth/core/generators/auth-email-password/generated/template-paths.d.ts +5 -0
  91. package/dist/local-auth/core/generators/auth-email-password/generated/template-paths.js +5 -0
  92. package/dist/local-auth/core/generators/auth-email-password/generated/template-renderers.d.ts +27 -0
  93. package/dist/local-auth/core/generators/auth-email-password/generated/template-renderers.js +71 -4
  94. package/dist/local-auth/core/generators/auth-email-password/generated/ts-import-providers.d.ts +1 -3
  95. package/dist/local-auth/core/generators/auth-email-password/generated/ts-import-providers.js +1 -2
  96. package/dist/local-auth/core/generators/auth-email-password/generated/typed-templates.d.ts +226 -10
  97. package/dist/local-auth/core/generators/auth-email-password/generated/typed-templates.js +91 -7
  98. package/dist/local-auth/core/generators/auth-email-password/templates/module/constants/otp.constants.d.ts +19 -0
  99. package/dist/local-auth/core/generators/auth-email-password/templates/module/constants/otp.constants.js +20 -0
  100. package/dist/local-auth/core/generators/auth-email-password/templates/module/constants/otp.constants.ts +22 -0
  101. package/dist/local-auth/core/generators/auth-email-password/templates/module/constants/password.constants.d.ts +12 -0
  102. package/dist/local-auth/core/generators/auth-email-password/templates/module/constants/password.constants.js +12 -0
  103. package/dist/local-auth/core/generators/auth-email-password/templates/module/constants/password.constants.ts +14 -0
  104. package/dist/local-auth/core/generators/auth-email-password/templates/module/schema/email-otp.mutations.d.ts +2 -0
  105. package/dist/local-auth/core/generators/auth-email-password/templates/module/schema/email-otp.mutations.js +30 -0
  106. package/dist/local-auth/core/generators/auth-email-password/templates/module/schema/email-otp.mutations.ts +38 -0
  107. package/dist/local-auth/core/generators/auth-email-password/templates/module/schema/invite.mutations.d.ts +2 -0
  108. package/dist/local-auth/core/generators/auth-email-password/templates/module/schema/invite.mutations.js +42 -0
  109. package/dist/local-auth/core/generators/auth-email-password/templates/module/schema/invite.mutations.ts +54 -0
  110. package/dist/local-auth/core/generators/auth-email-password/templates/module/schema/user-password.mutations.js +2 -19
  111. package/dist/local-auth/core/generators/auth-email-password/templates/module/schema/user-password.mutations.ts +1 -22
  112. package/dist/local-auth/core/generators/auth-email-password/templates/module/services/email-otp.service.d.ts +37 -0
  113. package/dist/local-auth/core/generators/auth-email-password/templates/module/services/email-otp.service.js +225 -0
  114. package/dist/local-auth/core/generators/auth-email-password/templates/module/services/email-otp.service.ts +333 -0
  115. package/dist/local-auth/core/generators/auth-email-password/templates/module/services/email-verification.service.js +2 -3
  116. package/dist/local-auth/core/generators/auth-email-password/templates/module/services/email-verification.service.ts +5 -3
  117. package/dist/local-auth/core/generators/auth-email-password/templates/module/services/invite.service.d.ts +39 -0
  118. package/dist/local-auth/core/generators/auth-email-password/templates/module/services/invite.service.js +142 -0
  119. package/dist/local-auth/core/generators/auth-email-password/templates/module/services/invite.service.ts +221 -0
  120. package/dist/local-auth/core/generators/auth-email-password/templates/module/services/password-reset.service.js +5 -6
  121. package/dist/local-auth/core/generators/auth-email-password/templates/module/services/password-reset.service.ts +8 -5
  122. package/dist/local-auth/core/generators/auth-email-templates/auth-email-templates.generator.d.ts +3 -1
  123. package/dist/local-auth/core/generators/auth-email-templates/auth-email-templates.generator.js +18 -3
  124. package/dist/local-auth/core/generators/auth-email-templates/generated/index.d.ts +40 -0
  125. package/dist/local-auth/core/generators/auth-email-templates/generated/template-paths.d.ts +2 -0
  126. package/dist/local-auth/core/generators/auth-email-templates/generated/template-paths.js +2 -0
  127. package/dist/local-auth/core/generators/auth-email-templates/generated/template-renderers.d.ts +6 -0
  128. package/dist/local-auth/core/generators/auth-email-templates/generated/template-renderers.js +20 -0
  129. package/dist/local-auth/core/generators/auth-email-templates/generated/typed-templates.d.ts +40 -0
  130. package/dist/local-auth/core/generators/auth-email-templates/generated/typed-templates.js +24 -0
  131. package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/email-otp.email.d.ts +3 -0
  132. package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/email-otp.email.js +18 -0
  133. package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/email-otp.email.tsx +57 -0
  134. package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/invite.email.d.ts +3 -0
  135. package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/invite.email.js +14 -0
  136. package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/invite.email.tsx +47 -0
  137. package/dist/local-auth/core/generators/auth-hooks/auth-hooks.generator.d.ts +272 -1
  138. package/dist/local-auth/core/generators/auth-hooks/generated/index.d.ts +547 -4
  139. package/dist/local-auth/core/generators/auth-hooks/generated/template-paths.d.ts +1 -1
  140. package/dist/local-auth/core/generators/auth-hooks/generated/template-paths.js +1 -1
  141. package/dist/local-auth/core/generators/auth-hooks/generated/template-renderers.d.ts +271 -0
  142. package/dist/local-auth/core/generators/auth-hooks/generated/template-renderers.js +4 -2
  143. package/dist/local-auth/core/generators/auth-hooks/generated/ts-import-providers.d.ts +2 -1
  144. package/dist/local-auth/core/generators/auth-hooks/generated/ts-import-providers.js +2 -1
  145. package/dist/local-auth/core/generators/auth-hooks/generated/typed-templates.d.ts +548 -6
  146. package/dist/local-auth/core/generators/auth-hooks/generated/typed-templates.js +15 -14
  147. package/dist/local-auth/core/generators/auth-hooks/templates/src/hooks/use-log-out.js +1 -1
  148. package/dist/local-auth/core/generators/auth-hooks/templates/src/hooks/use-log-out.ts +1 -1
  149. package/dist/local-auth/core/generators/auth-hooks/templates/src/hooks/use-session.d.ts +7 -0
  150. package/dist/local-auth/core/generators/auth-hooks/templates/src/hooks/use-session.ts +7 -0
  151. package/dist/local-auth/core/generators/auth-module/auth-module.generator.d.ts +23 -7
  152. package/dist/local-auth/core/generators/auth-module/auth-module.generator.js +7 -26
  153. package/dist/local-auth/core/generators/auth-module/generated/index.d.ts +65 -4
  154. package/dist/local-auth/core/generators/auth-module/generated/template-paths.d.ts +1 -1
  155. package/dist/local-auth/core/generators/auth-module/generated/template-paths.js +1 -1
  156. package/dist/local-auth/core/generators/auth-module/generated/template-renderers.d.ts +22 -1
  157. package/dist/local-auth/core/generators/auth-module/generated/template-renderers.js +19 -2
  158. package/dist/local-auth/core/generators/auth-module/generated/ts-import-providers.d.ts +10 -0
  159. package/dist/local-auth/core/generators/auth-module/generated/ts-import-providers.js +7 -0
  160. package/dist/local-auth/core/generators/auth-module/generated/typed-templates.d.ts +42 -4
  161. package/dist/local-auth/core/generators/auth-module/generated/typed-templates.js +24 -13
  162. package/dist/local-auth/core/generators/auth-module/templates/module/services/auth-verification.service.d.ts +4 -0
  163. package/dist/local-auth/core/generators/auth-module/templates/module/services/auth-verification.service.js +1 -1
  164. package/dist/local-auth/core/generators/auth-module/templates/module/services/auth-verification.service.ts +1 -1
  165. package/dist/local-auth/core/generators/auth-module/templates/module/services/code-verification.service.d.ts +67 -0
  166. package/dist/local-auth/core/generators/auth-module/templates/module/services/code-verification.service.js +140 -0
  167. package/dist/local-auth/core/generators/auth-module/templates/module/services/code-verification.service.ts +191 -0
  168. package/dist/local-auth/core/generators/auth-module/templates/module/services/user-session.service.js +8 -9
  169. package/dist/local-auth/core/generators/auth-module/templates/module/services/user-session.service.ts +10 -11
  170. package/dist/local-auth/core/generators/auth-routes/auth-routes.generator.d.ts +39 -0
  171. package/dist/local-auth/core/generators/auth-routes/auth-routes.generator.js +38 -5
  172. package/dist/local-auth/core/generators/auth-routes/generated/index.d.ts +1089 -268
  173. package/dist/local-auth/core/generators/auth-routes/generated/template-paths.d.ts +3 -0
  174. package/dist/local-auth/core/generators/auth-routes/generated/template-paths.js +3 -0
  175. package/dist/local-auth/core/generators/auth-routes/generated/template-renderers.d.ts +49 -0
  176. package/dist/local-auth/core/generators/auth-routes/generated/template-renderers.js +51 -0
  177. package/dist/local-auth/core/generators/auth-routes/generated/ts-import-providers.d.ts +1 -0
  178. package/dist/local-auth/core/generators/auth-routes/generated/ts-import-providers.js +1 -0
  179. package/dist/local-auth/core/generators/auth-routes/generated/typed-templates.d.ts +918 -283
  180. package/dist/local-auth/core/generators/auth-routes/generated/typed-templates.js +69 -23
  181. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/-otp-constants.d.ts +9 -0
  182. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/-otp-constants.js +10 -0
  183. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/-otp-constants.ts +11 -0
  184. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/accept-invite.d.ts +7 -0
  185. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/accept-invite.js +155 -0
  186. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/accept-invite.tsx +274 -0
  187. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/forgot-password.js +1 -2
  188. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/forgot-password.tsx +1 -1
  189. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/login-otp.d.ts +7 -0
  190. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/login-otp.js +184 -0
  191. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/login-otp.tsx +312 -0
  192. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/login.js +5 -5
  193. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/login.tsx +6 -12
  194. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/register.js +4 -4
  195. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/register.tsx +4 -3
  196. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/reset-password.js +1 -2
  197. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/reset-password.tsx +1 -1
  198. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/verify-email.js +1 -2
  199. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/verify-email.tsx +1 -1
  200. package/dist/local-auth/core/generators/react-session/generated/index.d.ts +90 -7
  201. package/dist/local-auth/core/generators/react-session/generated/template-renderers.d.ts +38 -1
  202. package/dist/local-auth/core/generators/react-session/generated/ts-import-providers.d.ts +1 -0
  203. package/dist/local-auth/core/generators/react-session/generated/ts-import-providers.js +1 -0
  204. package/dist/local-auth/core/generators/react-session/generated/typed-templates.d.ts +102 -12
  205. package/dist/local-auth/core/generators/react-session/generated/typed-templates.js +5 -2
  206. package/dist/local-auth/core/generators/react-session/react-session.generator.d.ts +54 -1
  207. package/dist/local-auth/core/generators/react-session/react-session.generator.js +35 -1
  208. package/dist/local-auth/core/generators/react-session/templates/src/app/user-session-provider.js +17 -44
  209. package/dist/local-auth/core/generators/react-session/templates/src/app/user-session-provider.tsx +21 -49
  210. package/dist/local-auth/core/generators/react-session/templates/src/services/user-session-client.d.ts +43 -34
  211. package/dist/local-auth/core/generators/react-session/templates/src/services/user-session-client.js +96 -80
  212. package/dist/local-auth/core/generators/react-session/templates/src/services/user-session-client.ts +148 -82
  213. package/dist/local-auth/core/generators/seed-initial-user/generated/index.d.ts +0 -2
  214. package/dist/local-auth/core/generators/seed-initial-user/generated/template-renderers.d.ts +0 -1
  215. package/dist/local-auth/core/generators/seed-initial-user/generated/typed-templates.d.ts +0 -1
  216. package/dist/local-auth/core/generators/seed-initial-user/seed-initial-user.generator.d.ts +0 -1
  217. package/dist/local-auth/core/node.js +30 -12
  218. package/dist/local-auth/core/schema/migrations.d.ts +3 -0
  219. package/dist/local-auth/core/schema/migrations.js +36 -0
  220. package/dist/local-auth/core/schema/models.js +8 -0
  221. package/dist/local-auth/core/schema/plugin-definition.d.ts +1 -0
  222. package/dist/local-auth/core/schema/plugin-definition.js +1 -0
  223. package/dist/local-auth/core/schema/web-app-schema.d.ts +15 -0
  224. package/dist/local-auth/core/schema/web-app-schema.js +16 -0
  225. package/dist/local-auth/core/web.js +8 -1
  226. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/index.d.ts +4 -3
  227. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/template-paths.d.ts +1 -1
  228. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/template-paths.js +1 -1
  229. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/ts-import-providers.d.ts +2 -1
  230. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/ts-import-providers.js +2 -1
  231. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/typed-templates.d.ts +4 -4
  232. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/typed-templates.js +13 -13
  233. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/placeholder-auth-hooks.generator.d.ts +1 -1
  234. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/templates/src/hooks/use-session.d.ts +1 -0
  235. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/templates/src/hooks/use-session.ts +2 -0
  236. package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/index.d.ts +1 -2
  237. package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/template-renderers.d.ts +0 -1
  238. package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/ts-import-providers.d.ts +1 -0
  239. package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/ts-import-providers.js +1 -0
  240. package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/typed-templates.d.ts +0 -1
  241. package/dist/placeholder-auth/core/generators/placeholder-auth-module/placeholder-auth-module.generator.d.ts +0 -1
  242. package/dist/web/assets/{_virtual_mf-localSharedImportMap___mfe_internal__plugin_mf_2_auth-ChkXxpXe.js → _virtual_mf-localSharedImportMap___mfe_internal__plugin_mf_2_auth__mf_owner__1-DUupKqD4.js} +42 -34
  243. package/dist/web/assets/{dist-DY7ZXvq4.js → _virtual_mf___mfe_internal__plugin_mf_2_auth__mf_owner__1__loadShare___mf_0_baseplate_mf_2_dev_mf_1_project_mf_2_builder_mf_2_lib__loadShare__.js-DE4rTqEA.js} +16857 -381
  244. 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-37vlYRxk.js → _virtual_mf___mfe_internal__plugin_mf_2_auth__mf_owner__1__loadShare___mf_0_baseplate_mf_2_dev_mf_1_project_mf_2_builder_mf_2_lib_mf_1_web__loadShare__.js-mszeXpf-.js} +90 -38
  245. 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-DRSNXPPo.js → _virtual_mf___mfe_internal__plugin_mf_2_auth__mf_owner__1__loadShare___mf_0_baseplate_mf_2_dev_mf_1_ui_mf_2_components__loadShare__.js-CtIleM_e.js} +4095 -2399
  246. package/dist/web/assets/{_virtual_mf___mfe_internal__plugin_mf_2_auth__loadShare___mf_0_tanstack_mf_1_react_mf_2_router__loadShare__.js-DfiQqvVC.js → _virtual_mf___mfe_internal__plugin_mf_2_auth__mf_owner__1__loadShare___mf_0_tanstack_mf_1_react_mf_2_router__loadShare__.js-BckLhSjF.js} +212 -57
  247. package/dist/web/assets/auth-DR6QxrAW.js +1 -0
  248. package/dist/web/assets/{common-iHaemino.js → common-BsyRiQi3.js} +6 -6
  249. package/dist/web/assets/{common-TDf_PrjX.js → common-CRwNlCMn.js} +10 -10
  250. package/dist/web/assets/{common-ByxS61u8.js → common-CvqlRZC9.js} +12 -12
  251. package/dist/web/assets/common-D3atSs7O.js +70 -0
  252. package/dist/web/assets/common-DuFyXa6l.js +36 -0
  253. package/dist/web/assets/common-islduJTj.js +43 -0
  254. package/dist/web/assets/{dist-CrLSslv6.js → dist-DQd1TAJX.js} +273 -132
  255. package/dist/web/assets/{get-auth-plugin-definition-kDCtXq_6.js → get-auth-plugin-definition-BgWWHl_Y.js} +3 -3
  256. package/dist/web/assets/{hostInit-Cruek6c6.js → hostInit-DNA4kLRY.js} +32 -5
  257. package/dist/web/assets/{mf-entry-bootstrap-0-dfed0275.js → mf-entry-bootstrap-0-ea77c09b.js} +2 -1
  258. package/dist/web/assets/{mf-entry-bootstrap-1-5275674a.js → mf-entry-bootstrap-1-9dee3d8d.js} +3 -2
  259. package/dist/web/assets/{mf-entry-bootstrap-2-39fb9255.js → mf-entry-bootstrap-2-3179040b.js} +3 -2
  260. package/dist/web/assets/{mf-entry-bootstrap-3-49e64336.js → mf-entry-bootstrap-3-370d200d.js} +3 -2
  261. package/dist/web/assets/{models-DSvs_3bA.js → models-BOeSYfRn.js} +4 -5
  262. package/dist/web/assets/{models-BZmCbizK.js → models-DF6DoXt6.js} +11 -6
  263. package/dist/web/assets/{plugin-definition-CYj29S3q.js → plugin-definition--k0VAeK3.js} +9 -10
  264. package/dist/web/assets/plugin-definition-CMwSlxsJ.js +10 -0
  265. package/dist/web/assets/{styles-yjbHBTlw.js → styles-BQEcQHoR.js} +9 -10
  266. package/dist/web/assets/{virtualExposes-CbPBmicF.js → virtualExposes-C7fDiAmS.js} +1 -1
  267. package/dist/web/assets/virtual_mf-REMOTE_ENTRY_ID___mfe_internal__plugin-auth__remoteEntry_js-BZBRyml2.js +747 -0
  268. package/dist/web/assets/{virtual_mf-exposes___mfe_internal__plugin-auth__remoteEntry_js-B6BXIeF1.js → virtual_mf-exposes___mfe_internal__plugin-auth__remoteEntry_js-6SjVUCs8.js} +13 -13
  269. package/dist/web/assets/web-8wz0ad-V.js +59 -0
  270. package/dist/web/assets/{web-CXAHKjIY.js → web-BGixH_gT.js} +27 -27
  271. package/dist/web/assets/{web-1eTcxMhf.js → web-BxIwkN3O.js} +6 -6
  272. package/dist/web/assets/{web-VqBA3jxZ.js → web-CQMfABjr.js} +24 -24
  273. package/dist/web/assets/{web-CDAKPPK9.js → web-CcNpItSu.js} +22 -22
  274. package/dist/web/assets/web-CypPeiVv.js +148 -0
  275. package/dist/web/assets/{web-D0MSKfyv.js → web-CzK_la2_.js} +53 -53
  276. package/dist/web/index.html +5 -5
  277. package/dist/web/remoteEntry.js +1 -1
  278. package/package.json +14 -14
  279. package/dist/local-auth/core/generators/auth-module/templates/module/utils/cookie-signer.d.ts +0 -38
  280. package/dist/local-auth/core/generators/auth-module/templates/module/utils/cookie-signer.js +0 -71
  281. package/dist/local-auth/core/generators/auth-module/templates/module/utils/cookie-signer.ts +0 -77
  282. 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-CO5Pvo0y.js +0 -384
  283. package/dist/web/assets/_virtual_mf___mfe_internal__plugin_mf_2_auth__loadShare__zod__loadShare__.js-BEZ7A-cz.js +0 -13566
  284. package/dist/web/assets/auth-BxAE0rgh.js +0 -1
  285. package/dist/web/assets/common-CKl_XlvH.js +0 -37
  286. package/dist/web/assets/common-UpVCKZeW.js +0 -41
  287. package/dist/web/assets/common-crSwCD36.js +0 -37
  288. package/dist/web/assets/model-utils-C0WDb_Ec.js +0 -1599
  289. package/dist/web/assets/plugin-definition-DOMmPL2Z.js +0 -11
  290. package/dist/web/assets/virtual_mf-REMOTE_ENTRY_ID___mfe_internal__plugin-auth__remoteEntry_js-XM6iYVxf.js +0 -259
  291. package/dist/web/assets/virtual_mf-exposes-ssr___mfe_internal__plugin-auth__remoteEntry_js-DGjg7Brm.js +0 -129
  292. package/dist/web/assets/web-DbeAaDTV.js +0 -118
  293. package/dist/web/assets/web-miDovYk_.js +0 -46
  294. package/dist/web/remoteEntry.ssr.js +0 -43
@@ -1,6 +1,6 @@
1
1
  export declare const authModuleGenerator: import("@baseplate-dev/sync").GeneratorBundleCreator<{
2
2
  userAdminRoles?: string[] | undefined;
3
- devWebPorts?: number[] | undefined;
3
+ emailOtp?: boolean | undefined;
4
4
  }, {
5
5
  paths: import("@baseplate-dev/sync").GeneratorTask<{
6
6
  localAuthCoreAuthModulePaths: import("@baseplate-dev/sync").ProviderExport<import("./generated/template-paths.js").LocalAuthCoreAuthModulePaths>;
@@ -12,10 +12,13 @@ export declare const authModuleGenerator: import("@baseplate-dev/sync").Generato
12
12
  cleanupAuthVerificationQueue: {};
13
13
  cleanupAuthVerificationWorker: {};
14
14
  cleanupExpiredAuthVerifications: {};
15
+ consumeCodeVerification: {};
15
16
  CookieUserSessionService: {};
16
17
  createAuthVerification: {};
18
+ createCodeVerification: {};
17
19
  userSessionPayload: {};
18
20
  validateAuthVerification: {};
21
+ validateCodeVerification: {};
19
22
  }>>;
20
23
  }, {
21
24
  paths: import("@baseplate-dev/sync").ProviderType<import("./generated/template-paths.js").LocalAuthCoreAuthModulePaths>;
@@ -23,6 +26,25 @@ export declare const authModuleGenerator: import("@baseplate-dev/sync").Generato
23
26
  renderers: import("@baseplate-dev/sync").GeneratorTask<{
24
27
  localAuthCoreAuthModuleRenderers: import("@baseplate-dev/sync").ProviderExport<import("./generated/template-renderers.js").LocalAuthCoreAuthModuleRenderers>;
25
28
  }, {
29
+ appSecretImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
30
+ createSigner: {};
31
+ deriveKey: {};
32
+ SecretPolicy: {
33
+ isTypeOnly: true;
34
+ };
35
+ Signer: {
36
+ isTypeOnly: true;
37
+ };
38
+ }>>;
39
+ appUrlsImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
40
+ getApiUrl: {};
41
+ getWebAppForUrl: {};
42
+ getWebOrigins: {};
43
+ getWebUrl: {};
44
+ WebAppName: {
45
+ isTypeOnly: true;
46
+ };
47
+ }>>;
26
48
  authContextImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
27
49
  AuthContext: {
28
50
  isTypeOnly: true;
@@ -33,7 +55,6 @@ export declare const authModuleGenerator: import("@baseplate-dev/sync").Generato
33
55
  AuthUserSessionInfo: {
34
56
  isTypeOnly: true;
35
57
  };
36
- createAnonymousAuthContext: {};
37
58
  createAuthContextFromSessionInfo: {};
38
59
  createSystemAuthContext: {};
39
60
  InvalidSessionError: {};
@@ -154,11 +175,6 @@ export declare const authModuleGenerator: import("@baseplate-dev/sync").Generato
154
175
  };
155
176
  }>>;
156
177
  }, undefined>;
157
- config: import("@baseplate-dev/sync").GeneratorTask<undefined, {
158
- provider: import("@baseplate-dev/sync").ProviderType<Omit<import("@baseplate-dev/utils").FieldMap<{
159
- configFields: import("@baseplate-dev/utils").MapContainer<string, import("@baseplate-dev/fastify-generators").ConfigServiceField>;
160
- }>, "getValues">>;
161
- }, undefined>;
162
178
  appModule: import("@baseplate-dev/sync").GeneratorTask<any, {
163
179
  paths: import("@baseplate-dev/sync").ProviderType<import("./generated/template-paths.js").LocalAuthCoreAuthModulePaths>;
164
180
  appModule: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/fastify-generators").AppModuleProvider>;
@@ -1,44 +1,22 @@
1
1
  import { tsCodeFragment, TsCodeUtils, tsTypeImportBuilder, } from '@baseplate-dev/core-generators';
2
- import { appModuleProvider, appRuntimeConfigProvider, configServiceProvider, createPothosPrismaObjectTypeOutputName, pothosTypeOutputProvider, prismaOutputProvider, } from '@baseplate-dev/fastify-generators';
3
- import { createGenerator, createGeneratorTask, createProviderTask, } from '@baseplate-dev/sync';
2
+ import { appModuleProvider, appRuntimeConfigProvider, createPothosPrismaObjectTypeOutputName, pothosTypeOutputProvider, prismaOutputProvider, } from '@baseplate-dev/fastify-generators';
3
+ import { createGenerator, createGeneratorTask } from '@baseplate-dev/sync';
4
4
  import { quot } from '@baseplate-dev/utils';
5
5
  import { z } from 'zod';
6
6
  import { LOCAL_AUTH_MODELS } from '#src/local-auth/constants/model-names.js';
7
7
  import { LOCAL_AUTH_CORE_AUTH_MODULE_GENERATED as GENERATED_TEMPLATES } from './generated/index.js';
8
8
  const descriptorSchema = z.object({
9
9
  userAdminRoles: z.array(z.string()).default([]),
10
- devWebPorts: z.array(z.number()).default([]),
10
+ emailOtp: z.boolean().default(false),
11
11
  });
12
12
  export const authModuleGenerator = createGenerator({
13
13
  name: 'local-auth/core/auth-module',
14
14
  generatorFileUrl: import.meta.url,
15
15
  descriptorSchema,
16
- buildTasks: ({ userAdminRoles, devWebPorts }) => ({
16
+ buildTasks: ({ userAdminRoles, emailOtp }) => ({
17
17
  paths: GENERATED_TEMPLATES.paths.task,
18
18
  imports: GENERATED_TEMPLATES.imports.task,
19
19
  renderers: GENERATED_TEMPLATES.renderers.task,
20
- config: createProviderTask(configServiceProvider, (configService) => {
21
- const allowedOrigins = devWebPorts
22
- .map((p) => `http://localhost:${String(p)}`)
23
- .join(',');
24
- configService.configFields.set('ALLOWED_ORIGINS', {
25
- validator: tsCodeFragment("z.string().optional().transform((val) => (val ? val.split(',').map((s) => s.trim()) : []))"),
26
- comment: 'Comma-separated list of additional allowed origins for CSRF protection (e.g. https://example.com,https://app.example.com)',
27
- ...(allowedOrigins
28
- ? {
29
- seedValue: allowedOrigins,
30
- exampleValue: allowedOrigins,
31
- }
32
- : {}),
33
- });
34
- const authSecret = 'a-secret-key-1234567890';
35
- configService.configFields.set('AUTH_SECRET', {
36
- validator: tsCodeFragment('z.string().regex(/^[a-zA-Z0-9-_+=/]{20,}$/)'),
37
- comment: 'Secret key for signing auth cookie (at least 20 alphanumeric characters)',
38
- seedValue: authSecret,
39
- exampleValue: authSecret,
40
- });
41
- }),
42
20
  appModule: createGeneratorTask({
43
21
  dependencies: {
44
22
  paths: GENERATED_TEMPLATES.paths.provider,
@@ -70,6 +48,9 @@ export const authModuleGenerator = createGenerator({
70
48
  },
71
49
  }));
72
50
  await builder.apply(renderers.servicesAuthVerification.render({}));
51
+ if (emailOtp) {
52
+ await builder.apply(renderers.servicesCodeVerification.render({}));
53
+ }
73
54
  await builder.apply(renderers.constantsGroup.render({}));
74
55
  await builder.apply(renderers.utilsGroup.render({}));
75
56
  await builder.apply(renderers.moduleGroup.render({
@@ -1,14 +1,18 @@
1
1
  export declare const LOCAL_AUTH_CORE_AUTH_MODULE_GENERATED: {
2
2
  imports: {
3
+ generatorName: string;
3
4
  task: import("@baseplate-dev/sync").GeneratorTask<{
4
5
  authModuleImports: import("@baseplate-dev/sync").ProviderExport<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
5
6
  cleanupAuthVerificationQueue: {};
6
7
  cleanupAuthVerificationWorker: {};
7
8
  cleanupExpiredAuthVerifications: {};
9
+ consumeCodeVerification: {};
8
10
  CookieUserSessionService: {};
9
11
  createAuthVerification: {};
12
+ createCodeVerification: {};
10
13
  userSessionPayload: {};
11
14
  validateAuthVerification: {};
15
+ validateCodeVerification: {};
12
16
  }>>;
13
17
  }, {
14
18
  paths: import("@baseplate-dev/sync").ProviderType<import("./template-paths.js").LocalAuthCoreAuthModulePaths>;
@@ -27,6 +31,25 @@ export declare const LOCAL_AUTH_CORE_AUTH_MODULE_GENERATED: {
27
31
  task: import("@baseplate-dev/sync").GeneratorTask<{
28
32
  localAuthCoreAuthModuleRenderers: import("@baseplate-dev/sync").ProviderExport<import("./template-renderers.js").LocalAuthCoreAuthModuleRenderers>;
29
33
  }, {
34
+ appSecretImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
35
+ createSigner: {};
36
+ deriveKey: {};
37
+ SecretPolicy: {
38
+ isTypeOnly: true;
39
+ };
40
+ Signer: {
41
+ isTypeOnly: true;
42
+ };
43
+ }>>;
44
+ appUrlsImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
45
+ getApiUrl: {};
46
+ getWebAppForUrl: {};
47
+ getWebOrigins: {};
48
+ getWebUrl: {};
49
+ WebAppName: {
50
+ isTypeOnly: true;
51
+ };
52
+ }>>;
30
53
  authContextImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
31
54
  AuthContext: {
32
55
  isTypeOnly: true;
@@ -37,7 +60,6 @@ export declare const LOCAL_AUTH_CORE_AUTH_MODULE_GENERATED: {
37
60
  AuthUserSessionInfo: {
38
61
  isTypeOnly: true;
39
62
  };
40
- createAnonymousAuthContext: {};
41
63
  createAuthContextFromSessionInfo: {};
42
64
  createSystemAuthContext: {};
43
65
  InvalidSessionError: {};
@@ -384,9 +406,51 @@ export declare const LOCAL_AUTH_CORE_AUTH_MODULE_GENERATED: {
384
406
  prisma: {};
385
407
  }>>;
386
408
  }, Record<never, Record<never, never>>>;
409
+ servicesCodeVerification: import("@baseplate-dev/core-generators").TsTemplateFile<{}, {
410
+ appSecretImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
411
+ createSigner: {};
412
+ deriveKey: {};
413
+ SecretPolicy: {
414
+ isTypeOnly: true;
415
+ };
416
+ Signer: {
417
+ isTypeOnly: true;
418
+ };
419
+ }>>;
420
+ prismaGeneratedImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
421
+ PrismaClient: {};
422
+ Prisma: {};
423
+ '*': {};
424
+ $Enums: {};
425
+ }>>;
426
+ prismaImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
427
+ prisma: {};
428
+ }>>;
429
+ }, {
430
+ servicesAuthVerification: {};
431
+ }>;
387
432
  userSessionService: import("@baseplate-dev/core-generators").TsTemplateFile<{
388
433
  TPL_PRISMA_USER_SESSION: {};
389
434
  }, {
435
+ appSecretImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
436
+ createSigner: {};
437
+ deriveKey: {};
438
+ SecretPolicy: {
439
+ isTypeOnly: true;
440
+ };
441
+ Signer: {
442
+ isTypeOnly: true;
443
+ };
444
+ }>>;
445
+ appUrlsImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
446
+ getApiUrl: {};
447
+ getWebAppForUrl: {};
448
+ getWebOrigins: {};
449
+ getWebUrl: {};
450
+ WebAppName: {
451
+ isTypeOnly: true;
452
+ };
453
+ }>>;
390
454
  authContextImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
391
455
  AuthContext: {
392
456
  isTypeOnly: true;
@@ -397,7 +461,6 @@ export declare const LOCAL_AUTH_CORE_AUTH_MODULE_GENERATED: {
397
461
  AuthUserSessionInfo: {
398
462
  isTypeOnly: true;
399
463
  };
400
- createAnonymousAuthContext: {};
401
464
  createAuthContextFromSessionInfo: {};
402
465
  createSystemAuthContext: {};
403
466
  InvalidSessionError: {};
@@ -450,13 +513,11 @@ export declare const LOCAL_AUTH_CORE_AUTH_MODULE_GENERATED: {
450
513
  };
451
514
  }>>;
452
515
  }, {
453
- cookieSigner: {};
454
516
  sessionCookie: {};
455
517
  userSessionConstants: {};
456
518
  verifyRequestOrigin: {};
457
519
  }>;
458
520
  utilsGroup: {
459
- cookieSigner: import("@baseplate-dev/core-generators").TsTemplateFile<{}, {}, Record<never, Record<never, never>>>;
460
521
  sessionCookie: import("@baseplate-dev/core-generators").TsTemplateFile<{}, {
461
522
  configServiceImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
462
523
  getConfig: {};
@@ -1,12 +1,12 @@
1
1
  export interface LocalAuthCoreAuthModulePaths {
2
2
  authRoleEnum: string;
3
- cookieSigner: string;
4
3
  queuesCleanupAuthVerification: string;
5
4
  queuesCleanupAuthVerificationWorker: string;
6
5
  schemaUserSessionMutations: string;
7
6
  schemaUserSessionPayloadObjectType: string;
8
7
  schemaUserSessionQueries: string;
9
8
  servicesAuthVerification: string;
9
+ servicesCodeVerification: string;
10
10
  sessionCookie: string;
11
11
  userRolesMutations: string;
12
12
  userRolesService: string;
@@ -12,13 +12,13 @@ const localAuthCoreAuthModulePathsTask = createGeneratorTask({
12
12
  providers: {
13
13
  localAuthCoreAuthModulePaths: {
14
14
  authRoleEnum: `${moduleRoot}/schema/auth-role.enum.ts`,
15
- cookieSigner: `${moduleRoot}/utils/cookie-signer.ts`,
16
15
  queuesCleanupAuthVerification: `${moduleRoot}/queues/cleanup-auth-verification.queue.ts`,
17
16
  queuesCleanupAuthVerificationWorker: `${moduleRoot}/queues/cleanup-auth-verification.worker.ts`,
18
17
  schemaUserSessionMutations: `${moduleRoot}/schema/user-session.mutations.ts`,
19
18
  schemaUserSessionPayloadObjectType: `${moduleRoot}/schema/user-session-payload.object-type.ts`,
20
19
  schemaUserSessionQueries: `${moduleRoot}/schema/user-session.queries.ts`,
21
20
  servicesAuthVerification: `${moduleRoot}/services/auth-verification.service.ts`,
21
+ servicesCodeVerification: `${moduleRoot}/services/code-verification.service.ts`,
22
22
  sessionCookie: `${moduleRoot}/utils/session-cookie.ts`,
23
23
  userRolesMutations: `${moduleRoot}/schema/user-roles.mutations.ts`,
24
24
  userRolesService: `${moduleRoot}/services/user-roles.service.ts`,
@@ -17,6 +17,9 @@ export interface LocalAuthCoreAuthModuleRenderers {
17
17
  servicesAuthVerification: {
18
18
  render: (options: Omit<RenderTsTemplateFileActionInput<typeof LOCAL_AUTH_CORE_AUTH_MODULE_TEMPLATES.servicesAuthVerification>, 'destination' | 'importMapProviders' | 'template' | 'generatorPaths'>) => BuilderAction;
19
19
  };
20
+ servicesCodeVerification: {
21
+ render: (options: Omit<RenderTsTemplateFileActionInput<typeof LOCAL_AUTH_CORE_AUTH_MODULE_TEMPLATES.servicesCodeVerification>, 'destination' | 'importMapProviders' | 'template' | 'generatorPaths'>) => BuilderAction;
22
+ };
20
23
  userSessionService: {
21
24
  render: (options: Omit<RenderTsTemplateFileActionInput<typeof LOCAL_AUTH_CORE_AUTH_MODULE_TEMPLATES.userSessionService>, 'destination' | 'importMapProviders' | 'template' | 'generatorPaths'>) => BuilderAction;
22
25
  };
@@ -29,6 +32,25 @@ export declare const LOCAL_AUTH_CORE_AUTH_MODULE_RENDERERS: {
29
32
  task: import("@baseplate-dev/sync").GeneratorTask<{
30
33
  localAuthCoreAuthModuleRenderers: import("@baseplate-dev/sync").ProviderExport<LocalAuthCoreAuthModuleRenderers>;
31
34
  }, {
35
+ appSecretImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
36
+ createSigner: {};
37
+ deriveKey: {};
38
+ SecretPolicy: {
39
+ isTypeOnly: true;
40
+ };
41
+ Signer: {
42
+ isTypeOnly: true;
43
+ };
44
+ }>>;
45
+ appUrlsImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
46
+ getApiUrl: {};
47
+ getWebAppForUrl: {};
48
+ getWebOrigins: {};
49
+ getWebUrl: {};
50
+ WebAppName: {
51
+ isTypeOnly: true;
52
+ };
53
+ }>>;
32
54
  authContextImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
33
55
  AuthContext: {
34
56
  isTypeOnly: true;
@@ -39,7 +61,6 @@ export declare const LOCAL_AUTH_CORE_AUTH_MODULE_RENDERERS: {
39
61
  AuthUserSessionInfo: {
40
62
  isTypeOnly: true;
41
63
  };
42
- createAnonymousAuthContext: {};
43
64
  createAuthContextFromSessionInfo: {};
44
65
  createSystemAuthContext: {};
45
66
  InvalidSessionError: {};
@@ -1,5 +1,5 @@
1
1
  import { typescriptFileProvider } from '@baseplate-dev/core-generators';
2
- import { authContextImportsProvider, authRolesImportsProvider, configServiceImportsProvider, errorHandlerServiceImportsProvider, pothosImportsProvider, prismaGeneratedImportsProvider, prismaImportsProvider, requestServiceContextImportsProvider, userSessionTypesImportsProvider, } from '@baseplate-dev/fastify-generators';
2
+ import { appSecretImportsProvider, appUrlsImportsProvider, authContextImportsProvider, authRolesImportsProvider, configServiceImportsProvider, errorHandlerServiceImportsProvider, pothosImportsProvider, prismaGeneratedImportsProvider, prismaImportsProvider, requestServiceContextImportsProvider, userSessionTypesImportsProvider, } from '@baseplate-dev/fastify-generators';
3
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';
@@ -7,6 +7,8 @@ import { LOCAL_AUTH_CORE_AUTH_MODULE_TEMPLATES } from './typed-templates.js';
7
7
  const localAuthCoreAuthModuleRenderers = createProviderType('local-auth-core-auth-module-renderers');
8
8
  const localAuthCoreAuthModuleRenderersTask = createGeneratorTask({
9
9
  dependencies: {
10
+ appSecretImports: appSecretImportsProvider,
11
+ appUrlsImports: appUrlsImportsProvider,
10
12
  authContextImports: authContextImportsProvider,
11
13
  authRolesImports: authRolesImportsProvider,
12
14
  configServiceImports: configServiceImportsProvider,
@@ -23,7 +25,7 @@ const localAuthCoreAuthModuleRenderersTask = createGeneratorTask({
23
25
  exports: {
24
26
  localAuthCoreAuthModuleRenderers: localAuthCoreAuthModuleRenderers.export(),
25
27
  },
26
- run({ authContextImports, authRolesImports, configServiceImports, errorHandlerServiceImports, paths, pothosImports, prismaGeneratedImports, prismaImports, queuesImports, requestServiceContextImports, typescriptFile, userSessionTypesImports, }) {
28
+ run({ appSecretImports, appUrlsImports, authContextImports, authRolesImports, configServiceImports, errorHandlerServiceImports, paths, pothosImports, prismaGeneratedImports, prismaImports, queuesImports, requestServiceContextImports, typescriptFile, userSessionTypesImports, }) {
27
29
  return {
28
30
  providers: {
29
31
  localAuthCoreAuthModuleRenderers: {
@@ -81,11 +83,26 @@ const localAuthCoreAuthModuleRenderersTask = createGeneratorTask({
81
83
  ...options,
82
84
  }),
83
85
  },
86
+ servicesCodeVerification: {
87
+ render: (options) => typescriptFile.renderTemplateFile({
88
+ template: LOCAL_AUTH_CORE_AUTH_MODULE_TEMPLATES.servicesCodeVerification,
89
+ destination: paths.servicesCodeVerification,
90
+ importMapProviders: {
91
+ appSecretImports,
92
+ prismaGeneratedImports,
93
+ prismaImports,
94
+ },
95
+ generatorPaths: paths,
96
+ ...options,
97
+ }),
98
+ },
84
99
  userSessionService: {
85
100
  render: (options) => typescriptFile.renderTemplateFile({
86
101
  template: LOCAL_AUTH_CORE_AUTH_MODULE_TEMPLATES.userSessionService,
87
102
  destination: paths.userSessionService,
88
103
  importMapProviders: {
104
+ appSecretImports,
105
+ appUrlsImports,
89
106
  authContextImports,
90
107
  authRolesImports,
91
108
  configServiceImports,
@@ -3,31 +3,41 @@ export declare const authModuleImportsSchema: {
3
3
  cleanupAuthVerificationQueue: {};
4
4
  cleanupAuthVerificationWorker: {};
5
5
  cleanupExpiredAuthVerifications: {};
6
+ consumeCodeVerification: {};
6
7
  CookieUserSessionService: {};
7
8
  createAuthVerification: {};
9
+ createCodeVerification: {};
8
10
  userSessionPayload: {};
9
11
  validateAuthVerification: {};
12
+ validateCodeVerification: {};
10
13
  };
11
14
  export type AuthModuleImportsProvider = TsImportMapProviderFromSchema<typeof authModuleImportsSchema>;
12
15
  export declare const authModuleImportsProvider: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
13
16
  cleanupAuthVerificationQueue: {};
14
17
  cleanupAuthVerificationWorker: {};
15
18
  cleanupExpiredAuthVerifications: {};
19
+ consumeCodeVerification: {};
16
20
  CookieUserSessionService: {};
17
21
  createAuthVerification: {};
22
+ createCodeVerification: {};
18
23
  userSessionPayload: {};
19
24
  validateAuthVerification: {};
25
+ validateCodeVerification: {};
20
26
  }>>;
21
27
  export declare const LOCAL_AUTH_CORE_AUTH_MODULE_IMPORTS: {
28
+ generatorName: string;
22
29
  task: import("@baseplate-dev/sync").GeneratorTask<{
23
30
  authModuleImports: import("@baseplate-dev/sync").ProviderExport<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
24
31
  cleanupAuthVerificationQueue: {};
25
32
  cleanupAuthVerificationWorker: {};
26
33
  cleanupExpiredAuthVerifications: {};
34
+ consumeCodeVerification: {};
27
35
  CookieUserSessionService: {};
28
36
  createAuthVerification: {};
37
+ createCodeVerification: {};
29
38
  userSessionPayload: {};
30
39
  validateAuthVerification: {};
40
+ validateCodeVerification: {};
31
41
  }>>;
32
42
  }, {
33
43
  paths: import("@baseplate-dev/sync").ProviderType<import("./template-paths.js").LocalAuthCoreAuthModulePaths>;
@@ -5,10 +5,13 @@ export const authModuleImportsSchema = createTsImportMapSchema({
5
5
  cleanupAuthVerificationQueue: {},
6
6
  cleanupAuthVerificationWorker: {},
7
7
  cleanupExpiredAuthVerifications: {},
8
+ consumeCodeVerification: {},
8
9
  CookieUserSessionService: {},
9
10
  createAuthVerification: {},
11
+ createCodeVerification: {},
10
12
  userSessionPayload: {},
11
13
  validateAuthVerification: {},
14
+ validateCodeVerification: {},
12
15
  });
13
16
  export const authModuleImportsProvider = createReadOnlyProviderType('auth-module-imports');
14
17
  const localAuthCoreAuthModuleImportsTask = createGeneratorTask({
@@ -25,16 +28,20 @@ const localAuthCoreAuthModuleImportsTask = createGeneratorTask({
25
28
  cleanupAuthVerificationQueue: paths.queuesCleanupAuthVerification,
26
29
  cleanupAuthVerificationWorker: paths.queuesCleanupAuthVerificationWorker,
27
30
  cleanupExpiredAuthVerifications: paths.servicesAuthVerification,
31
+ consumeCodeVerification: paths.servicesCodeVerification,
28
32
  CookieUserSessionService: paths.userSessionService,
29
33
  createAuthVerification: paths.servicesAuthVerification,
34
+ createCodeVerification: paths.servicesCodeVerification,
30
35
  userSessionPayload: paths.schemaUserSessionPayloadObjectType,
31
36
  validateAuthVerification: paths.servicesAuthVerification,
37
+ validateCodeVerification: paths.servicesCodeVerification,
32
38
  }),
33
39
  },
34
40
  };
35
41
  },
36
42
  });
37
43
  export const LOCAL_AUTH_CORE_AUTH_MODULE_IMPORTS = {
44
+ generatorName: '@baseplate-dev/plugin-auth#local-auth/core/auth-module',
38
45
  task: localAuthCoreAuthModuleImportsTask,
39
46
  };
40
47
  //# sourceMappingURL=ts-import-providers.js.map
@@ -91,7 +91,6 @@ export declare const moduleGroup: {
91
91
  }, Record<never, Record<never, never>>>;
92
92
  };
93
93
  export declare const utilsGroup: {
94
- cookieSigner: import("@baseplate-dev/core-generators").TsTemplateFile<{}, {}, Record<never, Record<never, never>>>;
95
94
  sessionCookie: import("@baseplate-dev/core-generators").TsTemplateFile<{}, {
96
95
  configServiceImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
97
96
  getConfig: {};
@@ -325,9 +324,51 @@ export declare const LOCAL_AUTH_CORE_AUTH_MODULE_TEMPLATES: {
325
324
  prisma: {};
326
325
  }>>;
327
326
  }, Record<never, Record<never, never>>>;
327
+ servicesCodeVerification: import("@baseplate-dev/core-generators").TsTemplateFile<{}, {
328
+ appSecretImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
329
+ createSigner: {};
330
+ deriveKey: {};
331
+ SecretPolicy: {
332
+ isTypeOnly: true;
333
+ };
334
+ Signer: {
335
+ isTypeOnly: true;
336
+ };
337
+ }>>;
338
+ prismaGeneratedImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
339
+ PrismaClient: {};
340
+ Prisma: {};
341
+ '*': {};
342
+ $Enums: {};
343
+ }>>;
344
+ prismaImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
345
+ prisma: {};
346
+ }>>;
347
+ }, {
348
+ servicesAuthVerification: {};
349
+ }>;
328
350
  userSessionService: import("@baseplate-dev/core-generators").TsTemplateFile<{
329
351
  TPL_PRISMA_USER_SESSION: {};
330
352
  }, {
353
+ appSecretImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
354
+ createSigner: {};
355
+ deriveKey: {};
356
+ SecretPolicy: {
357
+ isTypeOnly: true;
358
+ };
359
+ Signer: {
360
+ isTypeOnly: true;
361
+ };
362
+ }>>;
363
+ appUrlsImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
364
+ getApiUrl: {};
365
+ getWebAppForUrl: {};
366
+ getWebOrigins: {};
367
+ getWebUrl: {};
368
+ WebAppName: {
369
+ isTypeOnly: true;
370
+ };
371
+ }>>;
331
372
  authContextImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
332
373
  AuthContext: {
333
374
  isTypeOnly: true;
@@ -338,7 +379,6 @@ export declare const LOCAL_AUTH_CORE_AUTH_MODULE_TEMPLATES: {
338
379
  AuthUserSessionInfo: {
339
380
  isTypeOnly: true;
340
381
  };
341
- createAnonymousAuthContext: {};
342
382
  createAuthContextFromSessionInfo: {};
343
383
  createSystemAuthContext: {};
344
384
  InvalidSessionError: {};
@@ -391,13 +431,11 @@ export declare const LOCAL_AUTH_CORE_AUTH_MODULE_TEMPLATES: {
391
431
  };
392
432
  }>>;
393
433
  }, {
394
- cookieSigner: {};
395
434
  sessionCookie: {};
396
435
  userSessionConstants: {};
397
436
  verifyRequestOrigin: {};
398
437
  }>;
399
438
  utilsGroup: {
400
- cookieSigner: import("@baseplate-dev/core-generators").TsTemplateFile<{}, {}, Record<never, Record<never, never>>>;
401
439
  sessionCookie: import("@baseplate-dev/core-generators").TsTemplateFile<{}, {
402
440
  configServiceImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
403
441
  getConfig: {};
@@ -1,5 +1,5 @@
1
1
  import { createTsTemplateFile } from '@baseplate-dev/core-generators';
2
- import { authContextImportsProvider, authRolesImportsProvider, configServiceImportsProvider, errorHandlerServiceImportsProvider, pothosImportsProvider, prismaGeneratedImportsProvider, prismaImportsProvider, requestServiceContextImportsProvider, userSessionTypesImportsProvider, } from '@baseplate-dev/fastify-generators';
2
+ import { appSecretImportsProvider, appUrlsImportsProvider, authContextImportsProvider, authRolesImportsProvider, configServiceImportsProvider, errorHandlerServiceImportsProvider, pothosImportsProvider, prismaGeneratedImportsProvider, prismaImportsProvider, requestServiceContextImportsProvider, userSessionTypesImportsProvider, } from '@baseplate-dev/fastify-generators';
3
3
  import { queuesImportsProvider } from '@baseplate-dev/plugin-queue';
4
4
  import path from 'node:path';
5
5
  const userSessionConstants = createTsTemplateFile({
@@ -140,9 +140,30 @@ const servicesAuthVerification = createTsTemplateFile({
140
140
  },
141
141
  variables: {},
142
142
  });
143
+ const servicesCodeVerification = createTsTemplateFile({
144
+ fileOptions: { kind: 'singleton' },
145
+ importMapProviders: {
146
+ appSecretImports: appSecretImportsProvider,
147
+ prismaGeneratedImports: prismaGeneratedImportsProvider,
148
+ prismaImports: prismaImportsProvider,
149
+ },
150
+ name: 'services-code-verification',
151
+ projectExports: {
152
+ consumeCodeVerification: { isTypeOnly: false },
153
+ createCodeVerification: { isTypeOnly: false },
154
+ validateCodeVerification: { isTypeOnly: false },
155
+ },
156
+ referencedGeneratorTemplates: { servicesAuthVerification: {} },
157
+ source: {
158
+ path: path.join(import.meta.dirname, '../templates/module/services/code-verification.service.ts'),
159
+ },
160
+ variables: {},
161
+ });
143
162
  const userSessionService = createTsTemplateFile({
144
163
  fileOptions: { kind: 'singleton' },
145
164
  importMapProviders: {
165
+ appSecretImports: appSecretImportsProvider,
166
+ appUrlsImports: appUrlsImportsProvider,
146
167
  authContextImports: authContextImportsProvider,
147
168
  authRolesImports: authRolesImportsProvider,
148
169
  configServiceImports: configServiceImportsProvider,
@@ -154,7 +175,6 @@ const userSessionService = createTsTemplateFile({
154
175
  name: 'user-session-service',
155
176
  projectExports: { CookieUserSessionService: { isTypeOnly: false } },
156
177
  referencedGeneratorTemplates: {
157
- cookieSigner: {},
158
178
  sessionCookie: {},
159
179
  userSessionConstants: {},
160
180
  verifyRequestOrigin: {},
@@ -164,16 +184,6 @@ const userSessionService = createTsTemplateFile({
164
184
  },
165
185
  variables: { TPL_PRISMA_USER_SESSION: {} },
166
186
  });
167
- const cookieSigner = createTsTemplateFile({
168
- fileOptions: { kind: 'singleton' },
169
- group: 'utils',
170
- importMapProviders: {},
171
- name: 'cookie-signer',
172
- source: {
173
- path: path.join(import.meta.dirname, '../templates/module/utils/cookie-signer.ts'),
174
- },
175
- variables: {},
176
- });
177
187
  const sessionCookie = createTsTemplateFile({
178
188
  fileOptions: { kind: 'singleton' },
179
189
  group: 'utils',
@@ -194,13 +204,14 @@ const verifyRequestOrigin = createTsTemplateFile({
194
204
  },
195
205
  variables: {},
196
206
  });
197
- export const utilsGroup = { cookieSigner, sessionCookie, verifyRequestOrigin };
207
+ export const utilsGroup = { sessionCookie, verifyRequestOrigin };
198
208
  export const LOCAL_AUTH_CORE_AUTH_MODULE_TEMPLATES = {
199
209
  constantsGroup,
200
210
  moduleGroup,
201
211
  queuesCleanupAuthVerification,
202
212
  queuesCleanupAuthVerificationWorker,
203
213
  servicesAuthVerification,
214
+ servicesCodeVerification,
204
215
  userSessionService,
205
216
  utilsGroup,
206
217
  };
@@ -1,4 +1,8 @@
1
1
  import type { AuthVerification, Prisma } from '%prismaGeneratedImports';
2
+ /**
3
+ * Constant-time comparison of two hex strings to prevent timing attacks.
4
+ */
5
+ export declare function safeCompare(a: string, b: string): boolean;
2
6
  /**
3
7
  * Creates a new auth verification using the split-token pattern.
4
8
  *
@@ -20,7 +20,7 @@ function hashVerifier(verifier) {
20
20
  /**
21
21
  * Constant-time comparison of two hex strings to prevent timing attacks.
22
22
  */
23
- function safeCompare(a, b) {
23
+ export function safeCompare(a, b) {
24
24
  if (a.length !== b.length)
25
25
  return false;
26
26
  return crypto.timingSafeEqual(Buffer.from(a, 'hex'), Buffer.from(b, 'hex'));
@@ -27,7 +27,7 @@ function hashVerifier(verifier: string): string {
27
27
  /**
28
28
  * Constant-time comparison of two hex strings to prevent timing attacks.
29
29
  */
30
- function safeCompare(a: string, b: string): boolean {
30
+ export function safeCompare(a: string, b: string): boolean {
31
31
  if (a.length !== b.length) return false;
32
32
  return crypto.timingSafeEqual(Buffer.from(a, 'hex'), Buffer.from(b, 'hex'));
33
33
  }