@baseplate-dev/plugin-auth 4.0.1 → 4.0.3

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 (285) hide show
  1. package/CHANGELOG.md +645 -0
  2. package/dist/auth0/core/schema/plugin-definition.js +1 -1
  3. package/dist/auth0/core/schema/plugin-definition.js.map +1 -1
  4. package/dist/auth0/generators/fastify/auth0-module/templates/module/schema/user-session.queries.ts +1 -1
  5. package/dist/auth0/generators/react/auth0-hooks/auth0-hooks.generator.js +1 -1
  6. package/dist/auth0/generators/react/auth0-hooks/auth0-hooks.generator.js.map +1 -1
  7. package/dist/local-auth/constants/model-names.d.ts +4 -0
  8. package/dist/local-auth/constants/model-names.d.ts.map +1 -1
  9. package/dist/local-auth/constants/model-names.js +4 -0
  10. package/dist/local-auth/constants/model-names.js.map +1 -1
  11. package/dist/local-auth/core/generators/auth-email-password/auth-email-password.generator.d.ts +53 -0
  12. package/dist/local-auth/core/generators/auth-email-password/auth-email-password.generator.d.ts.map +1 -1
  13. package/dist/local-auth/core/generators/auth-email-password/auth-email-password.generator.js +28 -7
  14. package/dist/local-auth/core/generators/auth-email-password/auth-email-password.generator.js.map +1 -1
  15. package/dist/local-auth/core/generators/auth-email-password/generated/index.d.ts +219 -0
  16. package/dist/local-auth/core/generators/auth-email-password/generated/index.d.ts.map +1 -1
  17. package/dist/local-auth/core/generators/auth-email-password/generated/template-paths.d.ts +4 -0
  18. package/dist/local-auth/core/generators/auth-email-password/generated/template-paths.d.ts.map +1 -1
  19. package/dist/local-auth/core/generators/auth-email-password/generated/template-paths.js +4 -0
  20. package/dist/local-auth/core/generators/auth-email-password/generated/template-paths.js.map +1 -1
  21. package/dist/local-auth/core/generators/auth-email-password/generated/template-renderers.d.ts +47 -1
  22. package/dist/local-auth/core/generators/auth-email-password/generated/template-renderers.d.ts.map +1 -1
  23. package/dist/local-auth/core/generators/auth-email-password/generated/template-renderers.js +38 -2
  24. package/dist/local-auth/core/generators/auth-email-password/generated/template-renderers.js.map +1 -1
  25. package/dist/local-auth/core/generators/auth-email-password/generated/ts-import-providers.d.ts +18 -0
  26. package/dist/local-auth/core/generators/auth-email-password/generated/ts-import-providers.d.ts.map +1 -1
  27. package/dist/local-auth/core/generators/auth-email-password/generated/ts-import-providers.js +12 -0
  28. package/dist/local-auth/core/generators/auth-email-password/generated/ts-import-providers.js.map +1 -1
  29. package/dist/local-auth/core/generators/auth-email-password/generated/typed-templates.d.ts +271 -0
  30. package/dist/local-auth/core/generators/auth-email-password/generated/typed-templates.d.ts.map +1 -1
  31. package/dist/local-auth/core/generators/auth-email-password/generated/typed-templates.js +85 -4
  32. package/dist/local-auth/core/generators/auth-email-password/generated/typed-templates.js.map +1 -1
  33. package/dist/local-auth/core/generators/auth-email-password/templates/module/constants/password.constants.d.ts +15 -0
  34. package/dist/local-auth/core/generators/auth-email-password/templates/module/constants/password.constants.d.ts.map +1 -1
  35. package/dist/local-auth/core/generators/auth-email-password/templates/module/constants/password.constants.js +15 -0
  36. package/dist/local-auth/core/generators/auth-email-password/templates/module/constants/password.constants.js.map +1 -1
  37. package/dist/local-auth/core/generators/auth-email-password/templates/module/constants/password.constants.ts +18 -0
  38. package/dist/local-auth/core/generators/auth-email-password/templates/module/schema/email-verification.mutations.d.ts +2 -0
  39. package/dist/local-auth/core/generators/auth-email-password/templates/module/schema/email-verification.mutations.d.ts.map +1 -0
  40. package/dist/local-auth/core/generators/auth-email-password/templates/module/schema/email-verification.mutations.js +24 -0
  41. package/dist/local-auth/core/generators/auth-email-password/templates/module/schema/email-verification.mutations.js.map +1 -0
  42. package/dist/local-auth/core/generators/auth-email-password/templates/module/schema/email-verification.mutations.ts +35 -0
  43. package/dist/local-auth/core/generators/auth-email-password/templates/module/schema/password-reset.mutations.d.ts +2 -0
  44. package/dist/local-auth/core/generators/auth-email-password/templates/module/schema/password-reset.mutations.d.ts.map +1 -0
  45. package/dist/local-auth/core/generators/auth-email-password/templates/module/schema/password-reset.mutations.js +38 -0
  46. package/dist/local-auth/core/generators/auth-email-password/templates/module/schema/password-reset.mutations.js.map +1 -0
  47. package/dist/local-auth/core/generators/auth-email-password/templates/module/schema/password-reset.mutations.ts +54 -0
  48. package/dist/local-auth/core/generators/auth-email-password/templates/module/services/email-verification.service.d.ts +24 -0
  49. package/dist/local-auth/core/generators/auth-email-password/templates/module/services/email-verification.service.d.ts.map +1 -0
  50. package/dist/local-auth/core/generators/auth-email-password/templates/module/services/email-verification.service.js +87 -0
  51. package/dist/local-auth/core/generators/auth-email-password/templates/module/services/email-verification.service.js.map +1 -0
  52. package/dist/local-auth/core/generators/auth-email-password/templates/module/services/email-verification.service.ts +140 -0
  53. package/dist/local-auth/core/generators/auth-email-password/templates/module/services/password-reset.service.d.ts +35 -0
  54. package/dist/local-auth/core/generators/auth-email-password/templates/module/services/password-reset.service.d.ts.map +1 -0
  55. package/dist/local-auth/core/generators/auth-email-password/templates/module/services/password-reset.service.js +156 -0
  56. package/dist/local-auth/core/generators/auth-email-password/templates/module/services/password-reset.service.js.map +1 -0
  57. package/dist/local-auth/core/generators/auth-email-password/templates/module/services/password-reset.service.ts +229 -0
  58. package/dist/local-auth/core/generators/auth-email-password/templates/module/services/user-password.service.d.ts.map +1 -1
  59. package/dist/local-auth/core/generators/auth-email-password/templates/module/services/user-password.service.js +48 -14
  60. package/dist/local-auth/core/generators/auth-email-password/templates/module/services/user-password.service.js.map +1 -1
  61. package/dist/local-auth/core/generators/auth-email-password/templates/module/services/user-password.service.ts +79 -15
  62. package/dist/local-auth/core/generators/auth-email-templates/auth-email-templates.generator.d.ts +43 -0
  63. package/dist/local-auth/core/generators/auth-email-templates/auth-email-templates.generator.d.ts.map +1 -0
  64. package/dist/local-auth/core/generators/auth-email-templates/auth-email-templates.generator.js +48 -0
  65. package/dist/local-auth/core/generators/auth-email-templates/auth-email-templates.generator.js.map +1 -0
  66. package/dist/local-auth/core/generators/auth-email-templates/generated/index.d.ts +96 -0
  67. package/dist/local-auth/core/generators/auth-email-templates/generated/index.d.ts.map +1 -0
  68. package/dist/local-auth/core/generators/auth-email-templates/generated/index.js +11 -0
  69. package/dist/local-auth/core/generators/auth-email-templates/generated/index.js.map +1 -0
  70. package/dist/local-auth/core/generators/auth-email-templates/generated/template-paths.d.ts +14 -0
  71. package/dist/local-auth/core/generators/auth-email-templates/generated/template-paths.d.ts.map +1 -0
  72. package/dist/local-auth/core/generators/auth-email-templates/generated/template-paths.js +26 -0
  73. package/dist/local-auth/core/generators/auth-email-templates/generated/template-paths.js.map +1 -0
  74. package/dist/local-auth/core/generators/auth-email-templates/generated/template-renderers.d.ts +41 -0
  75. package/dist/local-auth/core/generators/auth-email-templates/generated/template-renderers.d.ts.map +1 -0
  76. package/dist/local-auth/core/generators/auth-email-templates/generated/template-renderers.js +59 -0
  77. package/dist/local-auth/core/generators/auth-email-templates/generated/template-renderers.js.map +1 -0
  78. package/dist/local-auth/core/generators/auth-email-templates/generated/typed-templates.d.ts +60 -0
  79. package/dist/local-auth/core/generators/auth-email-templates/generated/typed-templates.d.ts.map +1 -0
  80. package/dist/local-auth/core/generators/auth-email-templates/generated/typed-templates.js +42 -0
  81. package/dist/local-auth/core/generators/auth-email-templates/generated/typed-templates.js.map +1 -0
  82. package/dist/local-auth/core/generators/auth-email-templates/index.d.ts +2 -0
  83. package/dist/local-auth/core/generators/auth-email-templates/index.d.ts.map +1 -0
  84. package/dist/local-auth/core/generators/auth-email-templates/index.js +2 -0
  85. package/dist/local-auth/core/generators/auth-email-templates/index.js.map +1 -0
  86. package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/account-verification.email.d.ts +3 -0
  87. package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/account-verification.email.d.ts.map +1 -0
  88. package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/account-verification.email.js +14 -0
  89. package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/account-verification.email.js.map +1 -0
  90. package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/account-verification.email.tsx +55 -0
  91. package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/password-changed.email.d.ts +3 -0
  92. package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/password-changed.email.d.ts.map +1 -0
  93. package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/password-changed.email.js +12 -0
  94. package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/password-changed.email.js.map +1 -0
  95. package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/password-changed.email.tsx +44 -0
  96. package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/password-reset.email.d.ts +3 -0
  97. package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/password-reset.email.d.ts.map +1 -0
  98. package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/password-reset.email.js +14 -0
  99. package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/password-reset.email.js.map +1 -0
  100. package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/password-reset.email.tsx +55 -0
  101. package/dist/local-auth/core/generators/auth-module/auth-module.generator.d.ts +11 -0
  102. package/dist/local-auth/core/generators/auth-module/auth-module.generator.d.ts.map +1 -1
  103. package/dist/local-auth/core/generators/auth-module/auth-module.generator.js +12 -2
  104. package/dist/local-auth/core/generators/auth-module/auth-module.generator.js.map +1 -1
  105. package/dist/local-auth/core/generators/auth-module/generated/index.d.ts +26 -0
  106. package/dist/local-auth/core/generators/auth-module/generated/index.d.ts.map +1 -1
  107. package/dist/local-auth/core/generators/auth-module/generated/template-paths.d.ts +2 -0
  108. package/dist/local-auth/core/generators/auth-module/generated/template-paths.d.ts.map +1 -1
  109. package/dist/local-auth/core/generators/auth-module/generated/template-paths.js +2 -0
  110. package/dist/local-auth/core/generators/auth-module/generated/template-paths.js.map +1 -1
  111. package/dist/local-auth/core/generators/auth-module/generated/template-renderers.d.ts +10 -0
  112. package/dist/local-auth/core/generators/auth-module/generated/template-renderers.d.ts.map +1 -1
  113. package/dist/local-auth/core/generators/auth-module/generated/template-renderers.js +25 -1
  114. package/dist/local-auth/core/generators/auth-module/generated/template-renderers.js.map +1 -1
  115. package/dist/local-auth/core/generators/auth-module/generated/ts-import-providers.d.ts +9 -0
  116. package/dist/local-auth/core/generators/auth-module/generated/ts-import-providers.d.ts.map +1 -1
  117. package/dist/local-auth/core/generators/auth-module/generated/ts-import-providers.js +6 -0
  118. package/dist/local-auth/core/generators/auth-module/generated/ts-import-providers.js.map +1 -1
  119. package/dist/local-auth/core/generators/auth-module/generated/typed-templates.d.ts +19 -0
  120. package/dist/local-auth/core/generators/auth-module/generated/typed-templates.d.ts.map +1 -1
  121. package/dist/local-auth/core/generators/auth-module/generated/typed-templates.js +30 -0
  122. package/dist/local-auth/core/generators/auth-module/generated/typed-templates.js.map +1 -1
  123. package/dist/local-auth/core/generators/auth-module/templates/module/queues/cleanup-auth-verification.queue.d.ts +6 -0
  124. package/dist/local-auth/core/generators/auth-module/templates/module/queues/cleanup-auth-verification.queue.d.ts.map +1 -0
  125. package/dist/local-auth/core/generators/auth-module/templates/module/queues/cleanup-auth-verification.queue.js +17 -0
  126. package/dist/local-auth/core/generators/auth-module/templates/module/queues/cleanup-auth-verification.queue.js.map +1 -0
  127. package/dist/local-auth/core/generators/auth-module/templates/module/queues/cleanup-auth-verification.queue.ts +21 -0
  128. package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-session.mutations.js +1 -1
  129. package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-session.mutations.js.map +1 -1
  130. package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-session.mutations.ts +1 -1
  131. package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-session.queries.js +2 -2
  132. package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-session.queries.js.map +1 -1
  133. package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-session.queries.ts +2 -2
  134. package/dist/local-auth/core/generators/auth-module/templates/module/services/auth-verification.service.d.ts +40 -0
  135. package/dist/local-auth/core/generators/auth-module/templates/module/services/auth-verification.service.d.ts.map +1 -0
  136. package/dist/local-auth/core/generators/auth-module/templates/module/services/auth-verification.service.js +106 -0
  137. package/dist/local-auth/core/generators/auth-module/templates/module/services/auth-verification.service.js.map +1 -0
  138. package/dist/local-auth/core/generators/auth-module/templates/module/services/auth-verification.service.ts +146 -0
  139. package/dist/local-auth/core/generators/auth-routes/auth-routes.generator.d.ts.map +1 -1
  140. package/dist/local-auth/core/generators/auth-routes/auth-routes.generator.js +1 -0
  141. package/dist/local-auth/core/generators/auth-routes/auth-routes.generator.js.map +1 -1
  142. package/dist/local-auth/core/generators/auth-routes/generated/index.d.ts +722 -4
  143. package/dist/local-auth/core/generators/auth-routes/generated/index.d.ts.map +1 -1
  144. package/dist/local-auth/core/generators/auth-routes/generated/index.js +2 -0
  145. package/dist/local-auth/core/generators/auth-routes/generated/index.js.map +1 -1
  146. package/dist/local-auth/core/generators/auth-routes/generated/template-paths.d.ts +4 -0
  147. package/dist/local-auth/core/generators/auth-routes/generated/template-paths.d.ts.map +1 -1
  148. package/dist/local-auth/core/generators/auth-routes/generated/template-paths.js +4 -0
  149. package/dist/local-auth/core/generators/auth-routes/generated/template-paths.js.map +1 -1
  150. package/dist/local-auth/core/generators/auth-routes/generated/template-renderers.d.ts +4 -1
  151. package/dist/local-auth/core/generators/auth-routes/generated/template-renderers.d.ts.map +1 -1
  152. package/dist/local-auth/core/generators/auth-routes/generated/template-renderers.js +14 -0
  153. package/dist/local-auth/core/generators/auth-routes/generated/template-renderers.js.map +1 -1
  154. package/dist/local-auth/core/generators/auth-routes/generated/ts-import-providers.d.ts +21 -0
  155. package/dist/local-auth/core/generators/auth-routes/generated/ts-import-providers.d.ts.map +1 -0
  156. package/dist/local-auth/core/generators/auth-routes/generated/ts-import-providers.js +30 -0
  157. package/dist/local-auth/core/generators/auth-routes/generated/ts-import-providers.js.map +1 -0
  158. package/dist/local-auth/core/generators/auth-routes/generated/typed-templates.d.ts +1216 -34
  159. package/dist/local-auth/core/generators/auth-routes/generated/typed-templates.d.ts.map +1 -1
  160. package/dist/local-auth/core/generators/auth-routes/generated/typed-templates.js +70 -2
  161. package/dist/local-auth/core/generators/auth-routes/generated/typed-templates.js.map +1 -1
  162. package/dist/local-auth/core/generators/auth-routes/index.d.ts +2 -0
  163. package/dist/local-auth/core/generators/auth-routes/index.d.ts.map +1 -1
  164. package/dist/local-auth/core/generators/auth-routes/index.js +1 -0
  165. package/dist/local-auth/core/generators/auth-routes/index.js.map +1 -1
  166. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/-constants.d.ts +10 -0
  167. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/-constants.d.ts.map +1 -0
  168. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/-constants.js +11 -0
  169. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/-constants.js.map +1 -0
  170. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/-constants.ts +12 -0
  171. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/forgot-password.d.ts +2 -0
  172. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/forgot-password.d.ts.map +1 -0
  173. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/forgot-password.js +60 -0
  174. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/forgot-password.js.map +1 -0
  175. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/forgot-password.tsx +127 -0
  176. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/login.d.ts +1 -1
  177. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/login.d.ts.map +1 -1
  178. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/login.js +6 -11
  179. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/login.js.map +1 -1
  180. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/login.tsx +20 -19
  181. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/register.d.ts +1 -1
  182. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/register.d.ts.map +1 -1
  183. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/register.js +2 -2
  184. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/register.js.map +1 -1
  185. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/register.tsx +2 -3
  186. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/reset-password.d.ts +7 -0
  187. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/reset-password.d.ts.map +1 -0
  188. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/reset-password.js +131 -0
  189. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/reset-password.js.map +1 -0
  190. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/reset-password.tsx +240 -0
  191. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/verify-email.d.ts +7 -0
  192. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/verify-email.d.ts.map +1 -0
  193. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/verify-email.js +106 -0
  194. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/verify-email.js.map +1 -0
  195. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/verify-email.tsx +206 -0
  196. package/dist/local-auth/core/generators/index.d.ts +1 -0
  197. package/dist/local-auth/core/generators/index.d.ts.map +1 -1
  198. package/dist/local-auth/core/generators/index.js +1 -0
  199. package/dist/local-auth/core/generators/index.js.map +1 -1
  200. package/dist/local-auth/core/generators/seed-initial-user/generated/index.d.ts +12 -0
  201. package/dist/local-auth/core/generators/seed-initial-user/generated/index.d.ts.map +1 -1
  202. package/dist/local-auth/core/generators/seed-initial-user/generated/template-renderers.d.ts +6 -0
  203. package/dist/local-auth/core/generators/seed-initial-user/generated/template-renderers.d.ts.map +1 -1
  204. package/dist/local-auth/core/generators/seed-initial-user/generated/typed-templates.d.ts +6 -0
  205. package/dist/local-auth/core/generators/seed-initial-user/generated/typed-templates.d.ts.map +1 -1
  206. package/dist/local-auth/core/generators/seed-initial-user/seed-initial-user.generator.d.ts +6 -0
  207. package/dist/local-auth/core/generators/seed-initial-user/seed-initial-user.generator.d.ts.map +1 -1
  208. package/dist/local-auth/core/generators/seed-initial-user/seed-initial-user.generator.js +1 -1
  209. package/dist/local-auth/core/generators/seed-initial-user/seed-initial-user.generator.js.map +1 -1
  210. package/dist/local-auth/core/node.d.ts.map +1 -1
  211. package/dist/local-auth/core/node.js +11 -1
  212. package/dist/local-auth/core/node.js.map +1 -1
  213. package/dist/local-auth/core/schema/models.d.ts.map +1 -1
  214. package/dist/local-auth/core/schema/models.js +60 -0
  215. package/dist/local-auth/core/schema/models.js.map +1 -1
  216. package/dist/placeholder-auth/core/schema/plugin-definition.js +1 -1
  217. package/dist/placeholder-auth/core/schema/plugin-definition.js.map +1 -1
  218. package/dist/web/assets/{__federation_expose_auth0CoreCommon-DLSGXjCI.js → __federation_expose_auth0CoreCommon-e_GtBIIm.js} +3 -3
  219. package/dist/web/assets/{__federation_expose_auth0CoreCommon-DLSGXjCI.js.map → __federation_expose_auth0CoreCommon-e_GtBIIm.js.map} +1 -1
  220. package/dist/web/assets/{__federation_expose_auth0CoreWeb-C7FfhlmF.js → __federation_expose_auth0CoreWeb-CTfPylMw.js} +5 -5
  221. package/dist/web/assets/{__federation_expose_auth0CoreWeb-C7FfhlmF.js.map → __federation_expose_auth0CoreWeb-CTfPylMw.js.map} +1 -1
  222. package/dist/web/assets/{__federation_expose_authCoreCommon-BF58isGa.js → __federation_expose_authCoreCommon-Bg2mzE9K.js} +3 -3
  223. package/dist/web/assets/{__federation_expose_authCoreCommon-BF58isGa.js.map → __federation_expose_authCoreCommon-Bg2mzE9K.js.map} +1 -1
  224. package/dist/web/assets/{__federation_expose_authCoreWeb-DMq9M88g.js → __federation_expose_authCoreWeb-DrOVHmj4.js} +6 -6
  225. package/dist/web/assets/{__federation_expose_authCoreWeb-DMq9M88g.js.map → __federation_expose_authCoreWeb-DrOVHmj4.js.map} +1 -1
  226. package/dist/web/assets/{__federation_expose_local-authAdminCommon-sQw4q5YX.js → __federation_expose_local-authAdminCommon-Bzb0P17-.js} +2 -2
  227. package/dist/web/assets/{__federation_expose_local-authAdminCommon-sQw4q5YX.js.map → __federation_expose_local-authAdminCommon-Bzb0P17-.js.map} +1 -1
  228. package/dist/web/assets/{__federation_expose_local-authAdminWeb-9FbO89NR.js → __federation_expose_local-authAdminWeb-D_LWcl7j.js} +3 -3
  229. package/dist/web/assets/{__federation_expose_local-authAdminWeb-9FbO89NR.js.map → __federation_expose_local-authAdminWeb-D_LWcl7j.js.map} +1 -1
  230. package/dist/web/assets/{__federation_expose_local-authCoreCommon-CpUK09_4.js → __federation_expose_local-authCoreCommon-D6OG-Rz6.js} +4 -4
  231. package/dist/web/assets/{__federation_expose_local-authCoreCommon-CpUK09_4.js.map → __federation_expose_local-authCoreCommon-D6OG-Rz6.js.map} +1 -1
  232. package/dist/web/assets/{__federation_expose_local-authCoreWeb-Czp0GaY1.js → __federation_expose_local-authCoreWeb-CaR8fx1f.js} +66 -6
  233. package/dist/web/assets/__federation_expose_local-authCoreWeb-CaR8fx1f.js.map +1 -0
  234. package/dist/web/assets/{__federation_expose_placeholder-authCoreCommon-CFDDdOMo.js → __federation_expose_placeholder-authCoreCommon-D7b3GEPP.js} +3 -3
  235. package/dist/web/assets/{__federation_expose_placeholder-authCoreCommon-CFDDdOMo.js.map → __federation_expose_placeholder-authCoreCommon-D7b3GEPP.js.map} +1 -1
  236. package/dist/web/assets/{__federation_expose_placeholder-authCoreWeb-Bcn1_oDP.js → __federation_expose_placeholder-authCoreWeb-VZzvid5j.js} +5 -5
  237. package/dist/web/assets/{__federation_expose_placeholder-authCoreWeb-Bcn1_oDP.js.map → __federation_expose_placeholder-authCoreWeb-VZzvid5j.js.map} +1 -1
  238. package/dist/web/assets/{__federation_fn_import-DsXcpNlB.js → __federation_fn_import-DfNliZHH.js} +2 -2
  239. package/dist/web/assets/{__federation_fn_import-DsXcpNlB.js.map → __federation_fn_import-DfNliZHH.js.map} +1 -1
  240. package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib/{web-zqe3PPcn.js → web-BqJ1vSYx.js} +8 -8
  241. package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib/web-BqJ1vSYx.js.map +1 -0
  242. package/dist/web/assets/__federation_shared_@baseplate-dev/{project-builder-lib-CmgMfkI5.js → project-builder-lib-qf98MMJC.js} +7137 -136
  243. package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib-qf98MMJC.js.map +1 -0
  244. package/dist/web/assets/__federation_shared_@baseplate-dev/ui-components-DFkMnXmX.js +52536 -0
  245. package/dist/web/assets/__federation_shared_@baseplate-dev/ui-components-DFkMnXmX.js.map +1 -0
  246. package/dist/web/assets/__federation_shared_@baseplate-dev/{utils-BO5VHrCf.js → utils-CApJheqk.js} +5 -6
  247. package/dist/web/assets/__federation_shared_@baseplate-dev/utils-CApJheqk.js.map +1 -0
  248. package/dist/web/assets/__federation_shared_@tanstack/{react-router-CNzDweD5.js → react-router-YQslfDyE.js} +1069 -746
  249. package/dist/web/assets/__federation_shared_@tanstack/react-router-YQslfDyE.js.map +1 -0
  250. package/dist/web/assets/{get-auth-plugin-definition-BV2O8wTa.js → get-auth-plugin-definition-CVuj_mvy.js} +2 -2
  251. package/dist/web/assets/{get-auth-plugin-definition-BV2O8wTa.js.map → get-auth-plugin-definition-CVuj_mvy.js.map} +1 -1
  252. package/dist/web/assets/{index-BL7fotl7.js → index-B00D4irM.js} +2 -2
  253. package/dist/web/assets/{index-BL7fotl7.js.map → index-B00D4irM.js.map} +1 -1
  254. package/dist/web/assets/{index.esm-B4RpOlq_.js → index.esm-1qBxxnfu.js} +2 -2
  255. package/dist/web/assets/{index.esm-B4RpOlq_.js.map → index.esm-1qBxxnfu.js.map} +1 -1
  256. package/dist/web/assets/{model-merger-BwRNqcBu.js → model-merger-59HLmy_J.js} +80 -23
  257. package/dist/web/assets/model-merger-59HLmy_J.js.map +1 -0
  258. package/dist/web/assets/{model-names-CEoSIalq.js → model-names-DrcaRxt1.js} +6 -2
  259. package/dist/web/assets/{model-names-CEoSIalq.js.map → model-names-DrcaRxt1.js.map} +1 -1
  260. package/dist/web/assets/{plugin-definition-BMTsmwyH.js → plugin-definition-BKCeZ0Ni.js} +2 -2
  261. package/dist/web/assets/{plugin-definition-BMTsmwyH.js.map → plugin-definition-BKCeZ0Ni.js.map} +1 -1
  262. package/dist/web/assets/{plugin-definition-DA9rJBcS.js → plugin-definition-B_hlyPlm.js} +3 -3
  263. package/dist/web/assets/plugin-definition-B_hlyPlm.js.map +1 -0
  264. package/dist/web/assets/{plugin-definition-CHD5r-h7.js → plugin-definition-Bkx-a_wA.js} +3 -3
  265. package/dist/web/assets/plugin-definition-Bkx-a_wA.js.map +1 -0
  266. package/dist/web/assets/{plugin-definition-B9d2CoQL.js → plugin-definition-CcdhC0td.js} +2 -2
  267. package/dist/web/assets/{plugin-definition-B9d2CoQL.js.map → plugin-definition-CcdhC0td.js.map} +1 -1
  268. package/dist/web/assets/{react-B9vhIZMy.js → react-Df9ccuow.js} +2 -2
  269. package/dist/web/assets/{react-B9vhIZMy.js.map → react-Df9ccuow.js.map} +1 -1
  270. package/dist/web/assets/remoteEntry.js +20 -20
  271. package/dist/web/assets/{style-DZ-aOCkd.css → style-DiK_rD1L.css} +1 -1
  272. package/dist/web/assets/{styles-CEm5K1iU.js → styles-CbPVroCT.js} +3 -3
  273. package/dist/web/assets/{styles-CEm5K1iU.js.map → styles-CbPVroCT.js.map} +1 -1
  274. package/dist/web/index.html +1 -1
  275. package/package.json +22 -19
  276. package/dist/web/assets/__federation_expose_local-authCoreWeb-Czp0GaY1.js.map +0 -1
  277. package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib/web-zqe3PPcn.js.map +0 -1
  278. package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib-CmgMfkI5.js.map +0 -1
  279. package/dist/web/assets/__federation_shared_@baseplate-dev/ui-components-D1Dayhn9.js +0 -24082
  280. package/dist/web/assets/__federation_shared_@baseplate-dev/ui-components-D1Dayhn9.js.map +0 -1
  281. package/dist/web/assets/__federation_shared_@baseplate-dev/utils-BO5VHrCf.js.map +0 -1
  282. package/dist/web/assets/__federation_shared_@tanstack/react-router-CNzDweD5.js.map +0 -1
  283. package/dist/web/assets/model-merger-BwRNqcBu.js.map +0 -1
  284. package/dist/web/assets/plugin-definition-CHD5r-h7.js.map +0 -1
  285. package/dist/web/assets/plugin-definition-DA9rJBcS.js.map +0 -1
@@ -1,18 +1,37 @@
1
1
  // @ts-nocheck
2
- import { PASSWORD_MIN_LENGTH } from '$constantsPassword';
3
- import { BadRequestError, handleZodRequestValidationError, NotFoundError, } from '%errorHandlerServiceImports';
2
+ import { PASSWORD_MAX_LENGTH, PASSWORD_MIN_LENGTH } from '$constantsPassword';
3
+ import { requestEmailVerification } from '$servicesEmailVerification';
4
+ import { BadRequestError, handleZodRequestValidationError, logError, NotFoundError, TooManyRequestsError, } from '%errorHandlerServiceImports';
4
5
  import { createPasswordHash, verifyPasswordHash, } from '%passwordHasherServiceImports';
5
6
  import { prisma } from '%prismaImports';
7
+ import { memoizeRateLimiter } from '%rateLimitImports';
6
8
  import { userSessionService } from '%userSessionServiceImports';
7
9
  import z from 'zod';
8
10
  const PROVIDER_ID = 'email-password';
9
- const MAX_VALUE_LENGTH = 255;
10
11
  const emailPasswordSchema = z.object({
11
12
  email: z
12
13
  .email()
13
- .max(MAX_VALUE_LENGTH)
14
+ .max(PASSWORD_MAX_LENGTH)
14
15
  .transform((value) => value.toLowerCase()),
15
- password: z.string().min(PASSWORD_MIN_LENGTH).max(MAX_VALUE_LENGTH),
16
+ password: z.string().min(PASSWORD_MIN_LENGTH).max(PASSWORD_MAX_LENGTH),
17
+ });
18
+ /**
19
+ * Rate limiters for authentication operations.
20
+ */
21
+ const getRegistrationLimiter = memoizeRateLimiter('registration', {
22
+ points: 10,
23
+ duration: 60 * 60, // 1 hour
24
+ blockDuration: 60 * 60, // Block for 1 hour if exceeded
25
+ });
26
+ const getLoginIpLimiter = memoizeRateLimiter('login-ip', {
27
+ points: 10,
28
+ duration: 60 * 60 * 24, // 24 hours
29
+ blockDuration: 60 * 60, // Block for 1 hour if exceeded
30
+ });
31
+ const getLoginConsecutiveFailsLimiter = memoizeRateLimiter('login-consecutive-fails', {
32
+ points: 5,
33
+ duration: 60 * 60 * 24, // 24 hours (duration for tracking)
34
+ blockDuration: 60 * 15, // Block for 15 minutes after 5 consecutive fails
16
35
  });
17
36
  export async function createUserWithEmailAndPassword({ input, }) {
18
37
  const { email, password } = await emailPasswordSchema
@@ -46,14 +65,28 @@ export async function createUserWithEmailAndPassword({ input, }) {
46
65
  return user;
47
66
  }
48
67
  export async function registerUserWithEmailAndPassword({ input, context, }) {
68
+ // Rate limit registration by IP
69
+ await getRegistrationLimiter().consumeOrThrow(context.reqInfo.ip, 'Too many registration attempts. Please try again later.', 'registration-rate-limited');
49
70
  const user = await createUserWithEmailAndPassword({ input });
50
71
  const session = await userSessionService.createSession(user.id, context);
72
+ // Send verification email (fire-and-forget, don't block registration)
73
+ requestEmailVerification({ userId: user.id, context }).catch(logError);
51
74
  return { session, user };
52
75
  }
53
76
  export async function authenticateUserWithEmailAndPassword({ input, context, }) {
54
77
  const { email, password } = await emailPasswordSchema
55
78
  .parseAsync(input)
56
79
  .catch(handleZodRequestValidationError);
80
+ // Rate limiting setup
81
+ const clientIp = context.reqInfo.ip;
82
+ const emailIpKey = `${email}_${clientIp}`;
83
+ // Check IP-based rate limit (slow brute force protection)
84
+ await getLoginIpLimiter().consumeOrThrow(clientIp, 'Too many login attempts. Please try again later.', 'login-ip-rate-limited');
85
+ // Check consecutive failures rate limit (fast brute force protection)
86
+ const consecutiveFailsResult = await getLoginConsecutiveFailsLimiter().get(emailIpKey);
87
+ if (consecutiveFailsResult && !consecutiveFailsResult.allowed) {
88
+ throw new TooManyRequestsError('Account temporarily locked due to too many failed attempts. Please try again later.', 'login-consecutive-fails-blocked', { retryAfterMs: consecutiveFailsResult.msBeforeNext });
89
+ }
57
90
  // check if user with that email exists
58
91
  const userAccount = await prisma.userAccount.findUnique({
59
92
  where: {
@@ -63,20 +96,21 @@ export async function authenticateUserWithEmailAndPassword({ input, context, })
63
96
  },
64
97
  },
65
98
  });
66
- if (userAccount === null) {
67
- throw new BadRequestError('Invalid email', 'invalid-email');
68
- }
69
99
  // check for password match
70
- const isValid = await verifyPasswordHash(userAccount.password ?? '', password);
71
- if (!isValid) {
72
- throw new BadRequestError('Invalid password', 'invalid-password');
100
+ const isValid = await verifyPasswordHash(userAccount?.password ?? '', password);
101
+ if (!isValid || !userAccount) {
102
+ // Track failed attempt
103
+ await getLoginConsecutiveFailsLimiter().consume(emailIpKey);
104
+ throw new BadRequestError('Invalid email or password', 'invalid-credentials');
73
105
  }
106
+ // Reset consecutive failures on successful login
107
+ await getLoginConsecutiveFailsLimiter().delete(emailIpKey);
74
108
  const session = await userSessionService.createSession(userAccount.userId, context);
75
109
  return { session };
76
110
  }
77
111
  const changePasswordSchema = z.object({
78
- currentPassword: z.string().min(1).max(MAX_VALUE_LENGTH),
79
- newPassword: z.string().min(PASSWORD_MIN_LENGTH).max(MAX_VALUE_LENGTH),
112
+ currentPassword: z.string().min(1).max(PASSWORD_MAX_LENGTH),
113
+ newPassword: z.string().min(PASSWORD_MIN_LENGTH).max(PASSWORD_MAX_LENGTH),
80
114
  });
81
115
  /**
82
116
  * Change a user's password after validating their current password.
@@ -120,7 +154,7 @@ export async function changeUserPassword({ userId, input, }) {
120
154
  });
121
155
  }
122
156
  const resetPasswordSchema = z.object({
123
- newPassword: z.string().min(PASSWORD_MIN_LENGTH).max(MAX_VALUE_LENGTH),
157
+ newPassword: z.string().min(PASSWORD_MIN_LENGTH).max(PASSWORD_MAX_LENGTH),
124
158
  });
125
159
  /**
126
160
  * Reset a user's password without requiring the current password.
@@ -1 +1 @@
1
- {"version":3,"file":"user-password.service.js","sourceRoot":"","sources":["../../../../../../../../src/local-auth/core/generators/auth-email-password/templates/module/services/user-password.service.ts"],"names":[],"mappings":"AAAA,cAAc;AAMd,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EACL,eAAe,EACf,+BAA+B,EAC/B,aAAa,GACd,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,CAAC,MAAM,KAAK,CAAC;AAEpB,MAAM,WAAW,GAAG,gBAAgB,CAAC;AAErC,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAE7B,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IACnC,KAAK,EAAE,CAAC;SACL,KAAK,EAAE;SACP,GAAG,CAAC,gBAAgB,CAAC;SACrB,SAAS,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC;IAC5C,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC,GAAG,CAAC,gBAAgB,CAAC;CACpE,CAAC,CAAC;AAEH,MAAM,CAAC,KAAK,UAAU,8BAA8B,CAAC,EACnD,KAAK,GAMN;IACC,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,MAAM,mBAAmB;SAClD,UAAU,CAAC,KAAK,CAAC;SACjB,KAAK,CAAC,+BAA+B,CAAC,CAAC;IAC1C,+CAA+C;IAC/C,MAAM,YAAY,GAAG,MAAM,MAAM,CAAC,WAAW,CAAC,UAAU,CAAC;QACvD,KAAK,EAAE;YACL,oBAAoB,EAAE;gBACpB,SAAS,EAAE,KAAK;gBAChB,UAAU,EAAE,WAAW;aACxB;SAC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AmB,CAAC,CAAC;IACtE,CAAC;IAED,4CAA4C;IAC5C,MAAM,YAAY,GAAG,MAAM,kBAAkB,CAAC,WAAW,CAAC,CAAC;IAC3D,MAAM,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC;QAC9B,KAAK,EAAE;YACL,oBAAoB,EAAE;gBACpB,SAAS,EAAE,IAAI,CAAC,KAAK;gBACrB,UAAU,EAAE,WAAW;aACxB;SACF;QACD,MAAM,EAAE;YACN,IAAI,EAAE;gBACJ,OAAO,EAAE;oBACP,EAAE,EAAE,MAAM;iBACX;aACF;YACD,SAAS,EAAE,IAAI,CAAC,KAAK;YACrB,UAAU,EAAE,WAAW;YACvB,QAAQ,EAAE,YAAY;SACvB;QACD,MAAM,EAAE;YACN,QAAQ,EAAE,YAAY;SACvB;KACF,CAAC,CAAC;IAEH,OAAO,IAAI,CAAC;AACd,CAAC"}
1
+ {"version":3,"file":"user-password.service.js","sourceRoot":"","sources":["../../../../../../../../src/local-auth/core/generators/auth-email-password/templates/module/services/user-password.service.ts"],"names":[],"mappings":"AAAA,cAAc;AAMd,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC9E,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EACL,eAAe,EACf,+BAA+B,EAC/B,QAAQ,EACR,aAAa,EACb,oBAAoB,GACrB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,CAAC,MAAM,KAAK,CAAC;AAEpB,MAAM,WAAW,GAAG,gBAAgB,CAAC;AAErC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,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OAAO,EAAE;oBACP,EAAE,EAAE,MAAM;iBACX;aACF;YACD,SAAS,EAAE,IAAI,CAAC,KAAK;YACrB,UAAU,EAAE,WAAW;YACvB,QAAQ,EAAE,YAAY;SACvB;QACD,MAAM,EAAE;YACN,QAAQ,EAAE,YAAY;SACvB;KACF,CAAC,CAAC;IAEH,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -4,32 +4,59 @@ import type { User } from '%prismaGeneratedImports';
4
4
  import type { RequestServiceContext } from '%requestServiceContextImports';
5
5
  import type { UserSessionPayload } from '%userSessionTypesImports';
6
6
 
7
- import { PASSWORD_MIN_LENGTH } from '$constantsPassword';
7
+ import { PASSWORD_MAX_LENGTH, PASSWORD_MIN_LENGTH } from '$constantsPassword';
8
+ import { requestEmailVerification } from '$servicesEmailVerification';
8
9
  import {
9
10
  BadRequestError,
10
11
  handleZodRequestValidationError,
12
+ logError,
11
13
  NotFoundError,
14
+ TooManyRequestsError,
12
15
  } from '%errorHandlerServiceImports';
13
16
  import {
14
17
  createPasswordHash,
15
18
  verifyPasswordHash,
16
19
  } from '%passwordHasherServiceImports';
17
20
  import { prisma } from '%prismaImports';
21
+ import { memoizeRateLimiter } from '%rateLimitImports';
18
22
  import { userSessionService } from '%userSessionServiceImports';
19
23
  import z from 'zod';
20
24
 
21
25
  const PROVIDER_ID = 'email-password';
22
26
 
23
- const MAX_VALUE_LENGTH = 255;
24
-
25
27
  const emailPasswordSchema = z.object({
26
28
  email: z
27
29
  .email()
28
- .max(MAX_VALUE_LENGTH)
30
+ .max(PASSWORD_MAX_LENGTH)
29
31
  .transform((value) => value.toLowerCase()),
30
- password: z.string().min(PASSWORD_MIN_LENGTH).max(MAX_VALUE_LENGTH),
32
+ password: z.string().min(PASSWORD_MIN_LENGTH).max(PASSWORD_MAX_LENGTH),
31
33
  });
32
34
 
35
+ /**
36
+ * Rate limiters for authentication operations.
37
+ */
38
+
39
+ const getRegistrationLimiter = memoizeRateLimiter('registration', {
40
+ points: 10,
41
+ duration: 60 * 60, // 1 hour
42
+ blockDuration: 60 * 60, // Block for 1 hour if exceeded
43
+ });
44
+
45
+ const getLoginIpLimiter = memoizeRateLimiter('login-ip', {
46
+ points: 10,
47
+ duration: 60 * 60 * 24, // 24 hours
48
+ blockDuration: 60 * 60, // Block for 1 hour if exceeded
49
+ });
50
+
51
+ const getLoginConsecutiveFailsLimiter = memoizeRateLimiter(
52
+ 'login-consecutive-fails',
53
+ {
54
+ points: 5,
55
+ duration: 60 * 60 * 24, // 24 hours (duration for tracking)
56
+ blockDuration: 60 * 15, // Block for 15 minutes after 5 consecutive fails
57
+ },
58
+ );
59
+
33
60
  export async function createUserWithEmailAndPassword({
34
61
  input,
35
62
  }: {
@@ -82,9 +109,19 @@ export async function registerUserWithEmailAndPassword({
82
109
  };
83
110
  context: RequestServiceContext;
84
111
  }): Promise<{ session: UserSessionPayload; user: User }> {
112
+ // Rate limit registration by IP
113
+ await getRegistrationLimiter().consumeOrThrow(
114
+ context.reqInfo.ip,
115
+ 'Too many registration attempts. Please try again later.',
116
+ 'registration-rate-limited',
117
+ );
118
+
85
119
  const user = await createUserWithEmailAndPassword({ input });
86
120
  const session = await userSessionService.createSession(user.id, context);
87
121
 
122
+ // Send verification email (fire-and-forget, don't block registration)
123
+ requestEmailVerification({ userId: user.id, context }).catch(logError);
124
+
88
125
  return { session, user };
89
126
  }
90
127
 
@@ -102,6 +139,29 @@ export async function authenticateUserWithEmailAndPassword({
102
139
  .parseAsync(input)
103
140
  .catch(handleZodRequestValidationError);
104
141
 
142
+ // Rate limiting setup
143
+ const clientIp = context.reqInfo.ip;
144
+ const emailIpKey = `${email}_${clientIp}`;
145
+
146
+ // Check IP-based rate limit (slow brute force protection)
147
+ await getLoginIpLimiter().consumeOrThrow(
148
+ clientIp,
149
+ 'Too many login attempts. Please try again later.',
150
+ 'login-ip-rate-limited',
151
+ );
152
+
153
+ // Check consecutive failures rate limit (fast brute force protection)
154
+ const consecutiveFailsResult =
155
+ await getLoginConsecutiveFailsLimiter().get(emailIpKey);
156
+
157
+ if (consecutiveFailsResult && !consecutiveFailsResult.allowed) {
158
+ throw new TooManyRequestsError(
159
+ 'Account temporarily locked due to too many failed attempts. Please try again later.',
160
+ 'login-consecutive-fails-blocked',
161
+ { retryAfterMs: consecutiveFailsResult.msBeforeNext },
162
+ );
163
+ }
164
+
105
165
  // check if user with that email exists
106
166
  const userAccount = await prisma.userAccount.findUnique({
107
167
  where: {
@@ -112,19 +172,23 @@ export async function authenticateUserWithEmailAndPassword({
112
172
  },
113
173
  });
114
174
 
115
- if (userAccount === null) {
116
- throw new BadRequestError('Invalid email', 'invalid-email');
117
- }
118
-
119
175
  // check for password match
120
176
  const isValid = await verifyPasswordHash(
121
- userAccount.password ?? '',
177
+ userAccount?.password ?? '',
122
178
  password,
123
179
  );
124
- if (!isValid) {
125
- throw new BadRequestError('Invalid password', 'invalid-password');
180
+ if (!isValid || !userAccount) {
181
+ // Track failed attempt
182
+ await getLoginConsecutiveFailsLimiter().consume(emailIpKey);
183
+ throw new BadRequestError(
184
+ 'Invalid email or password',
185
+ 'invalid-credentials',
186
+ );
126
187
  }
127
188
 
189
+ // Reset consecutive failures on successful login
190
+ await getLoginConsecutiveFailsLimiter().delete(emailIpKey);
191
+
128
192
  const session = await userSessionService.createSession(
129
193
  userAccount.userId,
130
194
  context,
@@ -134,8 +198,8 @@ export async function authenticateUserWithEmailAndPassword({
134
198
  }
135
199
 
136
200
  const changePasswordSchema = z.object({
137
- currentPassword: z.string().min(1).max(MAX_VALUE_LENGTH),
138
- newPassword: z.string().min(PASSWORD_MIN_LENGTH).max(MAX_VALUE_LENGTH),
201
+ currentPassword: z.string().min(1).max(PASSWORD_MAX_LENGTH),
202
+ newPassword: z.string().min(PASSWORD_MIN_LENGTH).max(PASSWORD_MAX_LENGTH),
139
203
  });
140
204
 
141
205
  /**
@@ -200,7 +264,7 @@ export async function changeUserPassword({
200
264
  }
201
265
 
202
266
  const resetPasswordSchema = z.object({
203
- newPassword: z.string().min(PASSWORD_MIN_LENGTH).max(MAX_VALUE_LENGTH),
267
+ newPassword: z.string().min(PASSWORD_MIN_LENGTH).max(PASSWORD_MAX_LENGTH),
204
268
  });
205
269
 
206
270
  /**
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Generator for auth email templates.
3
+ *
4
+ * Registers auth-related email templates (password reset, password changed,
5
+ * account verification) with the transactional email library and generates
6
+ * the corresponding .tsx template files.
7
+ */
8
+ export declare const authEmailTemplatesGenerator: import("@baseplate-dev/sync").GeneratorBundleCreator<Record<string, never>, {
9
+ paths: import("@baseplate-dev/sync").GeneratorTask<{
10
+ localAuthAuthEmailTemplatesPaths: import("@baseplate-dev/sync").ProviderExport<import("./generated/template-paths.js").LocalAuthAuthEmailTemplatesPaths>;
11
+ }, {
12
+ packageInfo: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").PackageInfoProvider>;
13
+ }, undefined>;
14
+ renderers: import("@baseplate-dev/sync").GeneratorTask<{
15
+ localAuthAuthEmailTemplatesRenderers: import("@baseplate-dev/sync").ProviderExport<import("./generated/template-renderers.js").LocalAuthAuthEmailTemplatesRenderers>;
16
+ }, {
17
+ paths: import("@baseplate-dev/sync").ProviderType<import("./generated/template-paths.js").LocalAuthAuthEmailTemplatesPaths>;
18
+ transactionalLibImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
19
+ Button: {};
20
+ defineEmail: {};
21
+ DefineEmailOptions: {
22
+ isTypeOnly: true;
23
+ };
24
+ Divider: {};
25
+ EmailComponent: {
26
+ isTypeOnly: true;
27
+ };
28
+ EmailLayout: {};
29
+ Heading: {};
30
+ renderEmail: {};
31
+ Section: {};
32
+ Text: {};
33
+ theme: {};
34
+ }>>;
35
+ typescriptFile: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").TypescriptFileProvider>;
36
+ }, undefined>;
37
+ main: import("@baseplate-dev/sync").GeneratorTask<any, {
38
+ emailTemplates: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/plugin-email").EmailTemplatesProvider>;
39
+ paths: import("@baseplate-dev/sync").ProviderType<import("./generated/template-paths.js").LocalAuthAuthEmailTemplatesPaths>;
40
+ renderers: import("@baseplate-dev/sync").ProviderType<import("./generated/template-renderers.js").LocalAuthAuthEmailTemplatesRenderers>;
41
+ }, any>;
42
+ }>;
43
+ //# sourceMappingURL=auth-email-templates.generator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth-email-templates.generator.d.ts","sourceRoot":"","sources":["../../../../../src/local-auth/core/generators/auth-email-templates/auth-email-templates.generator.ts"],"names":[],"mappings":"AAQA;;;;;;GAMG;AACH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyCtC,CAAC"}
@@ -0,0 +1,48 @@
1
+ import { emailTemplatesProvider } from '@baseplate-dev/plugin-email';
2
+ import { createGenerator, createGeneratorTask } from '@baseplate-dev/sync';
3
+ import { z } from 'zod';
4
+ import { LOCAL_AUTH_AUTH_EMAIL_TEMPLATES_GENERATED as GENERATED_TEMPLATES } from './generated/index.js';
5
+ const descriptorSchema = z.object({});
6
+ /**
7
+ * Generator for auth email templates.
8
+ *
9
+ * Registers auth-related email templates (password reset, password changed,
10
+ * account verification) with the transactional email library and generates
11
+ * the corresponding .tsx template files.
12
+ */
13
+ export const authEmailTemplatesGenerator = createGenerator({
14
+ name: 'local-auth/auth-email-templates',
15
+ generatorFileUrl: import.meta.url,
16
+ descriptorSchema,
17
+ buildTasks: () => ({
18
+ paths: GENERATED_TEMPLATES.paths.task,
19
+ renderers: GENERATED_TEMPLATES.renderers.task,
20
+ main: createGeneratorTask({
21
+ dependencies: {
22
+ emailTemplates: emailTemplatesProvider,
23
+ paths: GENERATED_TEMPLATES.paths.provider,
24
+ renderers: GENERATED_TEMPLATES.renderers.provider,
25
+ },
26
+ run({ emailTemplates, paths, renderers }) {
27
+ emailTemplates.registerExport({
28
+ exportName: 'AccountVerificationEmail',
29
+ exportPath: paths.accountVerificationEmail,
30
+ });
31
+ emailTemplates.registerExport({
32
+ exportName: 'PasswordChangedEmail',
33
+ exportPath: paths.passwordChangedEmail,
34
+ });
35
+ emailTemplates.registerExport({
36
+ exportName: 'PasswordResetEmail',
37
+ exportPath: paths.passwordResetEmail,
38
+ });
39
+ return {
40
+ build: async (builder) => {
41
+ await builder.apply(renderers.accountVerificationEmail.render({}), renderers.passwordChangedEmail.render({}), renderers.passwordResetEmail.render({}));
42
+ },
43
+ };
44
+ },
45
+ }),
46
+ }),
47
+ });
48
+ //# sourceMappingURL=auth-email-templates.generator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth-email-templates.generator.js","sourceRoot":"","sources":["../../../../../src/local-auth/core/generators/auth-email-templates/auth-email-templates.generator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC3E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,yCAAyC,IAAI,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAExG,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAEtC;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,eAAe,CAAC;IACzD,IAAI,EAAE,iCAAiC;IACvC,gBAAgB,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG;IACjC,gBAAgB;IAChB,UAAU,EAAE,GAAG,EAAE,CAAC,CAAC;QACjB,KAAK,EAAE,mBAAmB,CAAC,KAAK,CAAC,IAAI;QACrC,SAAS,EAAE,mBAAmB,CAAC,SAAS,CAAC,IAAI;QAC7C,IAAI,EAAE,mBAAmB,CAAC;YACxB,YAAY,EAAE;gBACZ,cAAc,EAAE,sBAAsB;gBACtC,KAAK,EAAE,mBAAmB,CAAC,KAAK,CAAC,QAAQ;gBACzC,SAAS,EAAE,mBAAmB,CAAC,SAAS,CAAC,QAAQ;aAClD;YACD,GAAG,CAAC,EAAE,cAAc,EAAE,KAAK,EAAE,SAAS,EAAE;gBACtC,cAAc,CAAC,cAAc,CAAC;oBAC5B,UAAU,EAAE,0BAA0B;oBACtC,UAAU,EAAE,KAAK,CAAC,wBAAwB;iBAC3C,CAAC,CAAC;gBAEH,cAAc,CAAC,cAAc,CAAC;oBAC5B,UAAU,EAAE,sBAAsB;oBAClC,UAAU,EAAE,KAAK,CAAC,oBAAoB;iBACvC,CAAC,CAAC;gBAEH,cAAc,CAAC,cAAc,CAAC;oBAC5B,UAAU,EAAE,oBAAoB;oBAChC,UAAU,EAAE,KAAK,CAAC,kBAAkB;iBACrC,CAAC,CAAC;gBAEH,OAAO;oBACL,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;wBACvB,MAAM,OAAO,CAAC,KAAK,CACjB,SAAS,CAAC,wBAAwB,CAAC,MAAM,CAAC,EAAE,CAAC,EAC7C,SAAS,CAAC,oBAAoB,CAAC,MAAM,CAAC,EAAE,CAAC,EACzC,SAAS,CAAC,kBAAkB,CAAC,MAAM,CAAC,EAAE,CAAC,CACxC,CAAC;oBACJ,CAAC;iBACF,CAAC;YACJ,CAAC;SACF,CAAC;KACH,CAAC;CACH,CAAC,CAAC"}
@@ -0,0 +1,96 @@
1
+ export declare const LOCAL_AUTH_AUTH_EMAIL_TEMPLATES_GENERATED: {
2
+ paths: {
3
+ provider: import("@baseplate-dev/sync").ProviderType<import("./template-paths.js").LocalAuthAuthEmailTemplatesPaths>;
4
+ task: import("@baseplate-dev/sync").GeneratorTask<{
5
+ localAuthAuthEmailTemplatesPaths: import("@baseplate-dev/sync").ProviderExport<import("./template-paths.js").LocalAuthAuthEmailTemplatesPaths>;
6
+ }, {
7
+ packageInfo: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").PackageInfoProvider>;
8
+ }, undefined>;
9
+ };
10
+ renderers: {
11
+ provider: import("@baseplate-dev/sync").ProviderType<import("./template-renderers.js").LocalAuthAuthEmailTemplatesRenderers>;
12
+ task: import("@baseplate-dev/sync").GeneratorTask<{
13
+ localAuthAuthEmailTemplatesRenderers: import("@baseplate-dev/sync").ProviderExport<import("./template-renderers.js").LocalAuthAuthEmailTemplatesRenderers>;
14
+ }, {
15
+ paths: import("@baseplate-dev/sync").ProviderType<import("./template-paths.js").LocalAuthAuthEmailTemplatesPaths>;
16
+ transactionalLibImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
17
+ Button: {};
18
+ defineEmail: {};
19
+ DefineEmailOptions: {
20
+ isTypeOnly: true;
21
+ };
22
+ Divider: {};
23
+ EmailComponent: {
24
+ isTypeOnly: true;
25
+ };
26
+ EmailLayout: {};
27
+ Heading: {};
28
+ renderEmail: {};
29
+ Section: {};
30
+ Text: {};
31
+ theme: {};
32
+ }>>;
33
+ typescriptFile: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").TypescriptFileProvider>;
34
+ }, undefined>;
35
+ };
36
+ templates: {
37
+ accountVerificationEmail: import("@baseplate-dev/core-generators").TsTemplateFile<{}, {
38
+ transactionalLibImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
39
+ Button: {};
40
+ defineEmail: {};
41
+ DefineEmailOptions: {
42
+ isTypeOnly: true;
43
+ };
44
+ Divider: {};
45
+ EmailComponent: {
46
+ isTypeOnly: true;
47
+ };
48
+ EmailLayout: {};
49
+ Heading: {};
50
+ renderEmail: {};
51
+ Section: {};
52
+ Text: {};
53
+ theme: {};
54
+ }>>;
55
+ }, Record<never, Record<never, never>>>;
56
+ passwordChangedEmail: import("@baseplate-dev/core-generators").TsTemplateFile<{}, {
57
+ transactionalLibImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
58
+ Button: {};
59
+ defineEmail: {};
60
+ DefineEmailOptions: {
61
+ isTypeOnly: true;
62
+ };
63
+ Divider: {};
64
+ EmailComponent: {
65
+ isTypeOnly: true;
66
+ };
67
+ EmailLayout: {};
68
+ Heading: {};
69
+ renderEmail: {};
70
+ Section: {};
71
+ Text: {};
72
+ theme: {};
73
+ }>>;
74
+ }, Record<never, Record<never, never>>>;
75
+ passwordResetEmail: import("@baseplate-dev/core-generators").TsTemplateFile<{}, {
76
+ transactionalLibImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
77
+ Button: {};
78
+ defineEmail: {};
79
+ DefineEmailOptions: {
80
+ isTypeOnly: true;
81
+ };
82
+ Divider: {};
83
+ EmailComponent: {
84
+ isTypeOnly: true;
85
+ };
86
+ EmailLayout: {};
87
+ Heading: {};
88
+ renderEmail: {};
89
+ Section: {};
90
+ Text: {};
91
+ theme: {};
92
+ }>>;
93
+ }, Record<never, Record<never, never>>>;
94
+ };
95
+ };
96
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/local-auth/core/generators/auth-email-templates/generated/index.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,yCAAyC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAIrD,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { LOCAL_AUTH_AUTH_EMAIL_TEMPLATES_PATHS } from './template-paths.js';
2
+ import { LOCAL_AUTH_AUTH_EMAIL_TEMPLATES_RENDERERS } from './template-renderers.js';
3
+ import { LOCAL_AUTH_AUTH_EMAIL_TEMPLATES_TEMPLATES } from './typed-templates.js';
4
+ // This file is auto-generated by `pnpm generate:templates`
5
+ // Do not edit manually - run the command after adding templates
6
+ export const LOCAL_AUTH_AUTH_EMAIL_TEMPLATES_GENERATED = {
7
+ paths: LOCAL_AUTH_AUTH_EMAIL_TEMPLATES_PATHS,
8
+ renderers: LOCAL_AUTH_AUTH_EMAIL_TEMPLATES_RENDERERS,
9
+ templates: LOCAL_AUTH_AUTH_EMAIL_TEMPLATES_TEMPLATES,
10
+ };
11
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/local-auth/core/generators/auth-email-templates/generated/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qCAAqC,EAAE,MAAM,qBAAqB,CAAC;AAC5E,OAAO,EAAE,yCAAyC,EAAE,MAAM,yBAAyB,CAAC;AACpF,OAAO,EAAE,yCAAyC,EAAE,MAAM,sBAAsB,CAAC;AAEjF,2DAA2D;AAC3D,gEAAgE;AAChE,MAAM,CAAC,MAAM,yCAAyC,GAAG;IACvD,KAAK,EAAE,qCAAqC;IAC5C,SAAS,EAAE,yCAAyC;IACpD,SAAS,EAAE,yCAAyC;CACrD,CAAC"}
@@ -0,0 +1,14 @@
1
+ export interface LocalAuthAuthEmailTemplatesPaths {
2
+ accountVerificationEmail: string;
3
+ passwordChangedEmail: string;
4
+ passwordResetEmail: string;
5
+ }
6
+ export declare const LOCAL_AUTH_AUTH_EMAIL_TEMPLATES_PATHS: {
7
+ provider: import("@baseplate-dev/sync").ProviderType<LocalAuthAuthEmailTemplatesPaths>;
8
+ task: import("@baseplate-dev/sync").GeneratorTask<{
9
+ localAuthAuthEmailTemplatesPaths: import("@baseplate-dev/sync").ProviderExport<LocalAuthAuthEmailTemplatesPaths>;
10
+ }, {
11
+ packageInfo: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").PackageInfoProvider>;
12
+ }, undefined>;
13
+ };
14
+ //# sourceMappingURL=template-paths.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"template-paths.d.ts","sourceRoot":"","sources":["../../../../../../src/local-auth/core/generators/auth-email-templates/generated/template-paths.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,gCAAgC;IAC/C,wBAAwB,EAAE,MAAM,CAAC;IACjC,oBAAoB,EAAE,MAAM,CAAC;IAC7B,kBAAkB,EAAE,MAAM,CAAC;CAC5B;AA2BD,eAAO,MAAM,qCAAqC;;;;;;;CAGjD,CAAC"}
@@ -0,0 +1,26 @@
1
+ import { packageInfoProvider } from '@baseplate-dev/core-generators';
2
+ import { createGeneratorTask, createProviderType } from '@baseplate-dev/sync';
3
+ const localAuthAuthEmailTemplatesPaths = createProviderType('local-auth-auth-email-templates-paths');
4
+ const localAuthAuthEmailTemplatesPathsTask = createGeneratorTask({
5
+ dependencies: { packageInfo: packageInfoProvider },
6
+ exports: {
7
+ localAuthAuthEmailTemplatesPaths: localAuthAuthEmailTemplatesPaths.export(),
8
+ },
9
+ run({ packageInfo }) {
10
+ const srcRoot = packageInfo.getPackageSrcPath();
11
+ return {
12
+ providers: {
13
+ localAuthAuthEmailTemplatesPaths: {
14
+ accountVerificationEmail: `${srcRoot}/emails/auth/account-verification.email.tsx`,
15
+ passwordChangedEmail: `${srcRoot}/emails/auth/password-changed.email.tsx`,
16
+ passwordResetEmail: `${srcRoot}/emails/auth/password-reset.email.tsx`,
17
+ },
18
+ },
19
+ };
20
+ },
21
+ });
22
+ export const LOCAL_AUTH_AUTH_EMAIL_TEMPLATES_PATHS = {
23
+ provider: localAuthAuthEmailTemplatesPaths,
24
+ task: localAuthAuthEmailTemplatesPathsTask,
25
+ };
26
+ //# sourceMappingURL=template-paths.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"template-paths.js","sourceRoot":"","sources":["../../../../../../src/local-auth/core/generators/auth-email-templates/generated/template-paths.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAQ9E,MAAM,gCAAgC,GACpC,kBAAkB,CAChB,uCAAuC,CACxC,CAAC;AAEJ,MAAM,oCAAoC,GAAG,mBAAmB,CAAC;IAC/D,YAAY,EAAE,EAAE,WAAW,EAAE,mBAAmB,EAAE;IAClD,OAAO,EAAE;QACP,gCAAgC,EAAE,gCAAgC,CAAC,MAAM,EAAE;KAC5E;IACD,GAAG,CAAC,EAAE,WAAW,EAAE;QACjB,MAAM,OAAO,GAAG,WAAW,CAAC,iBAAiB,EAAE,CAAC;QAEhD,OAAO;YACL,SAAS,EAAE;gBACT,gCAAgC,EAAE;oBAChC,wBAAwB,EAAE,GAAG,OAAO,6CAA6C;oBACjF,oBAAoB,EAAE,GAAG,OAAO,yCAAyC;oBACzE,kBAAkB,EAAE,GAAG,OAAO,uCAAuC;iBACtE;aACF;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,qCAAqC,GAAG;IACnD,QAAQ,EAAE,gCAAgC;IAC1C,IAAI,EAAE,oCAAoC;CAC3C,CAAC"}
@@ -0,0 +1,41 @@
1
+ import type { RenderTsTemplateFileActionInput } from '@baseplate-dev/core-generators';
2
+ import type { BuilderAction } from '@baseplate-dev/sync';
3
+ import { LOCAL_AUTH_AUTH_EMAIL_TEMPLATES_TEMPLATES } from './typed-templates.js';
4
+ export interface LocalAuthAuthEmailTemplatesRenderers {
5
+ accountVerificationEmail: {
6
+ render: (options: Omit<RenderTsTemplateFileActionInput<typeof LOCAL_AUTH_AUTH_EMAIL_TEMPLATES_TEMPLATES.accountVerificationEmail>, 'destination' | 'importMapProviders' | 'template' | 'generatorPaths'>) => BuilderAction;
7
+ };
8
+ passwordChangedEmail: {
9
+ render: (options: Omit<RenderTsTemplateFileActionInput<typeof LOCAL_AUTH_AUTH_EMAIL_TEMPLATES_TEMPLATES.passwordChangedEmail>, 'destination' | 'importMapProviders' | 'template' | 'generatorPaths'>) => BuilderAction;
10
+ };
11
+ passwordResetEmail: {
12
+ render: (options: Omit<RenderTsTemplateFileActionInput<typeof LOCAL_AUTH_AUTH_EMAIL_TEMPLATES_TEMPLATES.passwordResetEmail>, 'destination' | 'importMapProviders' | 'template' | 'generatorPaths'>) => BuilderAction;
13
+ };
14
+ }
15
+ export declare const LOCAL_AUTH_AUTH_EMAIL_TEMPLATES_RENDERERS: {
16
+ provider: import("@baseplate-dev/sync").ProviderType<LocalAuthAuthEmailTemplatesRenderers>;
17
+ task: import("@baseplate-dev/sync").GeneratorTask<{
18
+ localAuthAuthEmailTemplatesRenderers: import("@baseplate-dev/sync").ProviderExport<LocalAuthAuthEmailTemplatesRenderers>;
19
+ }, {
20
+ paths: import("@baseplate-dev/sync").ProviderType<import("./template-paths.js").LocalAuthAuthEmailTemplatesPaths>;
21
+ transactionalLibImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
22
+ Button: {};
23
+ defineEmail: {};
24
+ DefineEmailOptions: {
25
+ isTypeOnly: true;
26
+ };
27
+ Divider: {};
28
+ EmailComponent: {
29
+ isTypeOnly: true;
30
+ };
31
+ EmailLayout: {};
32
+ Heading: {};
33
+ renderEmail: {};
34
+ Section: {};
35
+ Text: {};
36
+ theme: {};
37
+ }>>;
38
+ typescriptFile: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").TypescriptFileProvider>;
39
+ }, undefined>;
40
+ };
41
+ //# sourceMappingURL=template-renderers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"template-renderers.d.ts","sourceRoot":"","sources":["../../../../../../src/local-auth/core/generators/auth-email-templates/generated/template-renderers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,gCAAgC,CAAC;AACtF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAOzD,OAAO,EAAE,yCAAyC,EAAE,MAAM,sBAAsB,CAAC;AAEjF,MAAM,WAAW,oCAAoC;IACnD,wBAAwB,EAAE;QACxB,MAAM,EAAE,CACN,OAAO,EAAE,IAAI,CACX,+BAA+B,CAC7B,OAAO,yCAAyC,CAAC,wBAAwB,CAC1E,EACD,aAAa,GAAG,oBAAoB,GAAG,UAAU,GAAG,gBAAgB,CACrE,KACE,aAAa,CAAC;KACpB,CAAC;IACF,oBAAoB,EAAE;QACpB,MAAM,EAAE,CACN,OAAO,EAAE,IAAI,CACX,+BAA+B,CAC7B,OAAO,yCAAyC,CAAC,oBAAoB,CACtE,EACD,aAAa,GAAG,oBAAoB,GAAG,UAAU,GAAG,gBAAgB,CACrE,KACE,aAAa,CAAC;KACpB,CAAC;IACF,kBAAkB,EAAE;QAClB,MAAM,EAAE,CACN,OAAO,EAAE,IAAI,CACX,+BAA+B,CAC7B,OAAO,yCAAyC,CAAC,kBAAkB,CACpE,EACD,aAAa,GAAG,oBAAoB,GAAG,UAAU,GAAG,gBAAgB,CACrE,KACE,aAAa,CAAC;KACpB,CAAC;CACH;AA+DD,eAAO,MAAM,yCAAyC;;;;;;;;;;;;;;;;;;;;;;;;;CAGrD,CAAC"}