@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,5 +1,7 @@
1
1
  import { createTsTemplateFile } from '@baseplate-dev/core-generators';
2
- import { errorHandlerServiceImportsProvider, passwordHasherServiceImportsProvider, pothosImportsProvider, prismaGeneratedImportsProvider, prismaImportsProvider, requestServiceContextImportsProvider, userSessionServiceImportsProvider, userSessionTypesImportsProvider, } from '@baseplate-dev/fastify-generators';
2
+ import { configServiceImportsProvider, errorHandlerServiceImportsProvider, passwordHasherServiceImportsProvider, pothosImportsProvider, prismaGeneratedImportsProvider, prismaImportsProvider, requestServiceContextImportsProvider, userSessionServiceImportsProvider, userSessionTypesImportsProvider, } from '@baseplate-dev/fastify-generators';
3
+ import { emailModuleImportsProvider } from '@baseplate-dev/plugin-email';
4
+ import { rateLimitImportsProvider } from '@baseplate-dev/plugin-rate-limit';
3
5
  import path from 'node:path';
4
6
  import { authModuleImportsProvider } from '#src/local-auth/core/generators/auth-module/generated/ts-import-providers.js';
5
7
  const constantsPassword = createTsTemplateFile({
@@ -7,12 +9,27 @@ const constantsPassword = createTsTemplateFile({
7
9
  group: 'module',
8
10
  importMapProviders: {},
9
11
  name: 'constants-password',
10
- projectExports: { PASSWORD_MIN_LENGTH: {} },
12
+ projectExports: {
13
+ PASSWORD_MAX_LENGTH: {},
14
+ PASSWORD_MIN_LENGTH: {},
15
+ PASSWORD_RESET_TOKEN_EXPIRY_SEC: {},
16
+ },
11
17
  source: {
12
18
  path: path.join(import.meta.dirname, '../templates/module/constants/password.constants.ts'),
13
19
  },
14
20
  variables: {},
15
21
  });
22
+ const schemaPasswordResetMutations = createTsTemplateFile({
23
+ fileOptions: { kind: 'singleton' },
24
+ group: 'module',
25
+ importMapProviders: { pothosImports: pothosImportsProvider },
26
+ name: 'schema-password-reset-mutations',
27
+ referencedGeneratorTemplates: { servicesPasswordReset: {} },
28
+ source: {
29
+ path: path.join(import.meta.dirname, '../templates/module/schema/password-reset.mutations.ts'),
30
+ },
31
+ variables: {},
32
+ });
16
33
  const schemaUserPasswordMutations = createTsTemplateFile({
17
34
  fileOptions: { kind: 'singleton' },
18
35
  group: 'module',
@@ -27,6 +44,32 @@ const schemaUserPasswordMutations = createTsTemplateFile({
27
44
  },
28
45
  variables: { TPL_ADMIN_ROLES: {}, TPL_USER_OBJECT_TYPE: {} },
29
46
  });
47
+ const servicesPasswordReset = createTsTemplateFile({
48
+ fileOptions: { kind: 'singleton' },
49
+ group: 'module',
50
+ importMapProviders: {
51
+ authModuleImports: authModuleImportsProvider,
52
+ configServiceImports: configServiceImportsProvider,
53
+ emailModuleImports: emailModuleImportsProvider,
54
+ errorHandlerServiceImports: errorHandlerServiceImportsProvider,
55
+ passwordHasherServiceImports: passwordHasherServiceImportsProvider,
56
+ prismaImports: prismaImportsProvider,
57
+ rateLimitImports: rateLimitImportsProvider,
58
+ requestServiceContextImports: requestServiceContextImportsProvider,
59
+ },
60
+ name: 'services-password-reset',
61
+ projectExports: {
62
+ cleanupExpiredPasswordResetTokens: { isTypeOnly: false },
63
+ completePasswordReset: { isTypeOnly: false },
64
+ requestPasswordReset: { isTypeOnly: false },
65
+ validatePasswordResetToken: { isTypeOnly: false },
66
+ },
67
+ referencedGeneratorTemplates: { constantsPassword: {} },
68
+ source: {
69
+ path: path.join(import.meta.dirname, '../templates/module/services/password-reset.service.ts'),
70
+ },
71
+ variables: { TPL_PASSWORD_CHANGED_EMAIL: {}, TPL_PASSWORD_RESET_EMAIL: {} },
72
+ });
30
73
  const servicesUserPassword = createTsTemplateFile({
31
74
  fileOptions: { kind: 'singleton' },
32
75
  group: 'module',
@@ -35,6 +78,7 @@ const servicesUserPassword = createTsTemplateFile({
35
78
  passwordHasherServiceImports: passwordHasherServiceImportsProvider,
36
79
  prismaGeneratedImports: prismaGeneratedImportsProvider,
37
80
  prismaImports: prismaImportsProvider,
81
+ rateLimitImports: rateLimitImportsProvider,
38
82
  requestServiceContextImports: requestServiceContextImportsProvider,
39
83
  userSessionServiceImports: userSessionServiceImportsProvider,
40
84
  userSessionTypesImports: userSessionTypesImportsProvider,
@@ -45,7 +89,10 @@ const servicesUserPassword = createTsTemplateFile({
45
89
  createUserWithEmailAndPassword: {},
46
90
  registerUserWithEmailAndPassword: {},
47
91
  },
48
- referencedGeneratorTemplates: { constantsPassword: {} },
92
+ referencedGeneratorTemplates: {
93
+ constantsPassword: {},
94
+ servicesEmailVerification: {},
95
+ },
49
96
  source: {
50
97
  path: path.join(import.meta.dirname, '../templates/module/services/user-password.service.ts'),
51
98
  },
@@ -53,8 +100,42 @@ const servicesUserPassword = createTsTemplateFile({
53
100
  });
54
101
  export const moduleGroup = {
55
102
  constantsPassword,
103
+ schemaPasswordResetMutations,
56
104
  schemaUserPasswordMutations,
105
+ servicesPasswordReset,
57
106
  servicesUserPassword,
58
107
  };
59
- export const LOCAL_AUTH_CORE_AUTH_EMAIL_PASSWORD_TEMPLATES = { moduleGroup };
108
+ const schemaEmailVerificationMutations = createTsTemplateFile({
109
+ fileOptions: { kind: 'singleton' },
110
+ importMapProviders: { pothosImports: pothosImportsProvider },
111
+ name: 'schema-email-verification-mutations',
112
+ referencedGeneratorTemplates: { servicesEmailVerification: {} },
113
+ source: {
114
+ path: path.join(import.meta.dirname, '../templates/module/schema/email-verification.mutations.ts'),
115
+ },
116
+ variables: {},
117
+ });
118
+ const servicesEmailVerification = createTsTemplateFile({
119
+ fileOptions: { kind: 'singleton' },
120
+ importMapProviders: {
121
+ authModuleImports: authModuleImportsProvider,
122
+ configServiceImports: configServiceImportsProvider,
123
+ emailModuleImports: emailModuleImportsProvider,
124
+ errorHandlerServiceImports: errorHandlerServiceImportsProvider,
125
+ prismaImports: prismaImportsProvider,
126
+ rateLimitImports: rateLimitImportsProvider,
127
+ requestServiceContextImports: requestServiceContextImportsProvider,
128
+ },
129
+ name: 'services-email-verification',
130
+ referencedGeneratorTemplates: { constantsPassword: {} },
131
+ source: {
132
+ path: path.join(import.meta.dirname, '../templates/module/services/email-verification.service.ts'),
133
+ },
134
+ variables: { TPL_ACCOUNT_VERIFICATION_EMAIL: {} },
135
+ });
136
+ export const LOCAL_AUTH_CORE_AUTH_EMAIL_PASSWORD_TEMPLATES = {
137
+ moduleGroup,
138
+ schemaEmailVerificationMutations,
139
+ servicesEmailVerification,
140
+ };
60
141
  //# sourceMappingURL=typed-templates.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"typed-templates.js","sourceRoot":"","sources":["../../../../../../src/local-auth/core/generators/auth-email-password/generated/typed-templates.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AACtE,OAAO,EACL,kCAAkC,EAClC,oCAAoC,EACpC,qBAAqB,EACrB,8BAA8B,EAC9B,qBAAqB,EACrB,oCAAoC,EACpC,iCAAiC,EACjC,+BAA+B,GAChC,MAAM,mCAAmC,CAAC;AAC3C,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,yBAAyB,EAAE,MAAM,8EAA8E,CAAC;AAEzH,MAAM,iBAAiB,GAAG,oBAAoB,CAAC;IAC7C,WAAW,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE;IAClC,KAAK,EAAE,QAAQ;IACf,kBAAkB,EAAE,EAAE;IACtB,IAAI,EAAE,oBAAoB;IAC1B,cAAc,EAAE,EAAE,mBAAmB,EAAE,EAAE,EAAE;IAC3C,MAAM,EAAE;QACN,IAAI,EAAE,IAAI,CAAC,IAAI,CAC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AAE;CACd,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,iBAAiB;IACjB,2BAA2B;IAC3B,oBAAoB;CACrB,CAAC;AAEF,MAAM,CAAC,MAAM,6CAA6C,GAAG,EAAE,WAAW,EAAE,CAAC"}
1
+ {"version":3,"file":"typed-templates.js","sourceRoot":"","sources":["../../../../../../src/local-auth/core/generators/auth-email-password/generated/typed-templates.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AACtE,OAAO,EACL,4BAA4B,EAC5B,kCAAkC,EAClC,oCAAoC,EACpC,qBAAqB,EACrB,8BAA8B,EAC9B,qBAAqB,EACrB,oCAAoC,EACpC,iCAAiC,EACjC,+BAA+B,GAChC,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,0BAA0B,EAAE,MAAM,6BAA6B,CAAC;AACzE,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAC5E,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,yBAAyB,EAAE,MAAM,8EAA8E,CAAC;AAEzH,MAAM,iBAAiB,GAAG,oBAAoB,CAAC;IAC7C,WAAW,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE;IAClC,KAAK,EAAE,QAAQ;IACf,kBAAkB,EAAE,EAAE;IACtB,IAAI,EAAE,oBAAoB;IAC1B,cAAc,EAAE;QACd,mBAAmB,EAAE,EAAE;QACvB,mBAAmB,EAAE,EAAE;QACvB,+BAA+B,EAAE,EAAE;KACpC;IACD,MAAM,EAAE;QACN,IAAI,EAAE,IAAI,CAAC,IAAI,CACb,MAAM,CAAC,IAAI,CAAC,OAAO,EACnB,qDAAqD,CACtD;KACF;IACD,SAAS,EAAE,EAAE;CACd,CAAC,CAAC;AAEH,MAAM,4BAA4B,GAAG,oBAAoB,CAAC;IACxD,WAAW,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE;IAClC,KAAK,EAAE,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B,2BAA2B;IAC3B,qBAAqB;IACrB,oBAAoB;CACrB,CAAC;AAEF,MAAM,gCAAgC,GAAG,oBAAoB,CAAC;IAC5D,WAAW,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE;IAClC,kBAAkB,EAAE,EAAE,aAAa,EAAE,qBAAqB,EAAE;IAC5D,IAAI,EAAE,qCAAqC;IAC3C,4BAA4B,EAAE,EAAE,yBAAyB,EAAE,EAAE,EAAE;IAC/D,MAAM,EAAE;QACN,IAAI,EAAE,IAAI,CAAC,IAAI,CACb,MAAM,CAAC,IAAI,CAAC,OAAO,EACnB,4DAA4D,CAC7D;KACF;IACD,SAAS,EAAE,EAAE;CACd,CAAC,CAAC;AAEH,MAAM,yBAAyB,GAAG,oBAAoB,CAAC;IACrD,WAAW,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE;IAClC,kBAAkB,EAAE;QAClB,iBAAiB,EAAE,yBAAyB;QAC5C,oBAAoB,EAAE,4BAA4B;QAClD,kBAAkB,EAAE,0BAA0B;QAC9C,0BAA0B,EAAE,kCAAkC;QAC9D,aAAa,EAAE,qBAAqB;QACpC,gBAAgB,EAAE,wBAAwB;QAC1C,4BAA4B,EAAE,oCAAoC;KACnE;IACD,IAAI,EAAE,6BAA6B;IACnC,4BAA4B,EAAE,EAAE,iBAAiB,EAAE,EAAE,EAAE;IACvD,MAAM,EAAE;QACN,IAAI,EAAE,IAAI,CAAC,IAAI,CACb,MAAM,CAAC,IAAI,CAAC,OAAO,EACnB,4DAA4D,CAC7D;KACF;IACD,SAAS,EAAE,EAAE,8BAA8B,EAAE,EAAE,EAAE;CAClD,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,6CAA6C,GAAG;IAC3D,WAAW;IACX,gCAAgC;IAChC,yBAAyB;CAC1B,CAAC"}
@@ -1,2 +1,17 @@
1
+ /**
2
+ * Minimum password length
3
+ */
1
4
  export declare const PASSWORD_MIN_LENGTH = 8;
5
+ /**
6
+ * Maximum password length (prevents DoS attacks via excessive bcrypt/argon2 computation)
7
+ */
8
+ export declare const PASSWORD_MAX_LENGTH = 255;
9
+ /**
10
+ * Password reset token expiration time in seconds (1 hour per OWASP recommendations)
11
+ */
12
+ export declare const PASSWORD_RESET_TOKEN_EXPIRY_SEC: number;
13
+ /**
14
+ * Email verification token expiration time in seconds (24 hours)
15
+ */
16
+ export declare const EMAIL_VERIFICATION_TOKEN_EXPIRY_SEC: number;
2
17
  //# sourceMappingURL=password.constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"password.constants.d.ts","sourceRoot":"","sources":["../../../../../../../../src/local-auth/core/generators/auth-email-password/templates/module/constants/password.constants.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,mBAAmB,IAAI,CAAC"}
1
+ {"version":3,"file":"password.constants.d.ts","sourceRoot":"","sources":["../../../../../../../../src/local-auth/core/generators/auth-email-password/templates/module/constants/password.constants.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,eAAO,MAAM,mBAAmB,IAAI,CAAC;AAErC;;GAEG;AACH,eAAO,MAAM,mBAAmB,MAAM,CAAC;AAEvC;;GAEG;AACH,eAAO,MAAM,+BAA+B,QAAU,CAAC;AAEvD;;GAEG;AACH,eAAO,MAAM,mCAAmC,QAAe,CAAC"}
@@ -1,3 +1,18 @@
1
1
  // @ts-nocheck
2
+ /**
3
+ * Minimum password length
4
+ */
2
5
  export const PASSWORD_MIN_LENGTH = 8;
6
+ /**
7
+ * Maximum password length (prevents DoS attacks via excessive bcrypt/argon2 computation)
8
+ */
9
+ export const PASSWORD_MAX_LENGTH = 255;
10
+ /**
11
+ * Password reset token expiration time in seconds (1 hour per OWASP recommendations)
12
+ */
13
+ export const PASSWORD_RESET_TOKEN_EXPIRY_SEC = 60 * 60;
14
+ /**
15
+ * Email verification token expiration time in seconds (24 hours)
16
+ */
17
+ export const EMAIL_VERIFICATION_TOKEN_EXPIRY_SEC = 60 * 60 * 24;
3
18
  //# sourceMappingURL=password.constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"password.constants.js","sourceRoot":"","sources":["../../../../../../../../src/local-auth/core/generators/auth-email-password/templates/module/constants/password.constants.ts"],"names":[],"mappings":"AAAA,cAAc;AAEd,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC"}
1
+ {"version":3,"file":"password.constants.js","sourceRoot":"","sources":["../../../../../../../../src/local-auth/core/generators/auth-email-password/templates/module/constants/password.constants.ts"],"names":[],"mappings":"AAAA,cAAc;AAEd;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC;AAErC;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,CAAC;AAEvC;;GAEG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAAG,EAAE,GAAG,EAAE,CAAC;AAEvD;;GAEG;AACH,MAAM,CAAC,MAAM,mCAAmC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC"}
@@ -1,3 +1,21 @@
1
1
  // @ts-nocheck
2
2
 
3
+ /**
4
+ * Minimum password length
5
+ */
3
6
  export const PASSWORD_MIN_LENGTH = 8;
7
+
8
+ /**
9
+ * Maximum password length (prevents DoS attacks via excessive bcrypt/argon2 computation)
10
+ */
11
+ export const PASSWORD_MAX_LENGTH = 255;
12
+
13
+ /**
14
+ * Password reset token expiration time in seconds (1 hour per OWASP recommendations)
15
+ */
16
+ export const PASSWORD_RESET_TOKEN_EXPIRY_SEC = 60 * 60;
17
+
18
+ /**
19
+ * Email verification token expiration time in seconds (24 hours)
20
+ */
21
+ export const EMAIL_VERIFICATION_TOKEN_EXPIRY_SEC = 60 * 60 * 24;
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=email-verification.mutations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"email-verification.mutations.d.ts","sourceRoot":"","sources":["../../../../../../../../src/local-auth/core/generators/auth-email-password/templates/module/schema/email-verification.mutations.ts"],"names":[],"mappings":""}
@@ -0,0 +1,24 @@
1
+ // @ts-nocheck
2
+ import { requestEmailVerification, verifyEmail, } from '$servicesEmailVerification';
3
+ import { builder } from '%pothosImports';
4
+ builder.mutationField('requestEmailVerification', (t) => t.fieldWithInputPayload({
5
+ authorize: ['user'],
6
+ payload: {
7
+ success: t.payload.field({ type: 'Boolean' }),
8
+ },
9
+ resolve: async (_root, _args, context) => requestEmailVerification({
10
+ userId: context.auth.userIdOrThrow(),
11
+ context,
12
+ }),
13
+ }));
14
+ builder.mutationField('verifyEmail', (t) => t.fieldWithInputPayload({
15
+ authorize: ['public'],
16
+ payload: {
17
+ success: t.payload.field({ type: 'Boolean' }),
18
+ },
19
+ input: {
20
+ token: t.input.field({ required: true, type: 'String' }),
21
+ },
22
+ resolve: async (_root, { input }, context) => verifyEmail({ token: input.token, context }),
23
+ }));
24
+ //# sourceMappingURL=email-verification.mutations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"email-verification.mutations.js","sourceRoot":"","sources":["../../../../../../../../src/local-auth/core/generators/auth-email-password/templates/module/schema/email-verification.mutations.ts"],"names":[],"mappings":"AAAA,cAAc;AAEd,OAAO,EACL,wBAAwB,EACxB,WAAW,GACZ,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEzC,OAAO,CAAC,aAAa,CAAC,0BAA0B,EAAE,CAAC,CAAC,EAAE,EAAE,CACtD,CAAC,CAAC,qBAAqB,CAAC;IACtB,SAAS,EAAE,CAAC,MAAM,CAAC;IACnB,OAAO,EAAE;QACP,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;KAC9C;IACD,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,CACvC,wBAAwB,CAAC;QACvB,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,aAAa,EAAE;QACpC,OAAO;KACR,CAAC;CACL,CAAC,CACH,CAAC;AAEF,OAAO,CAAC,aAAa,CAAC,aAAa,EAAE,CAAC,CAAC,EAAE,EAAE,CACzC,CAAC,CAAC,qBAAqB,CAAC;IACtB,SAAS,EAAE,CAAC,QAAQ,CAAC;IACrB,OAAO,EAAE;QACP,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;KAC9C;IACD,KAAK,EAAE;QACL,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;KACzD;IACD,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,EAAE,CAC3C,WAAW,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,OAAO,EAAE,CAAC;CAC/C,CAAC,CACH,CAAC"}
@@ -0,0 +1,35 @@
1
+ // @ts-nocheck
2
+
3
+ import {
4
+ requestEmailVerification,
5
+ verifyEmail,
6
+ } from '$servicesEmailVerification';
7
+ import { builder } from '%pothosImports';
8
+
9
+ builder.mutationField('requestEmailVerification', (t) =>
10
+ t.fieldWithInputPayload({
11
+ authorize: ['user'],
12
+ payload: {
13
+ success: t.payload.field({ type: 'Boolean' }),
14
+ },
15
+ resolve: async (_root, _args, context) =>
16
+ requestEmailVerification({
17
+ userId: context.auth.userIdOrThrow(),
18
+ context,
19
+ }),
20
+ }),
21
+ );
22
+
23
+ builder.mutationField('verifyEmail', (t) =>
24
+ t.fieldWithInputPayload({
25
+ authorize: ['public'],
26
+ payload: {
27
+ success: t.payload.field({ type: 'Boolean' }),
28
+ },
29
+ input: {
30
+ token: t.input.field({ required: true, type: 'String' }),
31
+ },
32
+ resolve: async (_root, { input }, context) =>
33
+ verifyEmail({ token: input.token, context }),
34
+ }),
35
+ );
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=password-reset.mutations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"password-reset.mutations.d.ts","sourceRoot":"","sources":["../../../../../../../../src/local-auth/core/generators/auth-email-password/templates/module/schema/password-reset.mutations.ts"],"names":[],"mappings":""}
@@ -0,0 +1,38 @@
1
+ // @ts-nocheck
2
+ import { completePasswordReset, requestPasswordReset, validatePasswordResetToken, } from '$servicesPasswordReset';
3
+ import { builder } from '%pothosImports';
4
+ builder.mutationField('requestPasswordReset', (t) => t.fieldWithInputPayload({
5
+ authorize: ['public'],
6
+ payload: {
7
+ success: t.payload.field({ type: 'Boolean' }),
8
+ },
9
+ input: {
10
+ email: t.input.field({ required: true, type: 'String' }),
11
+ },
12
+ resolve: async (_root, { input }, context) => requestPasswordReset({ email: input.email, context }),
13
+ }));
14
+ builder.mutationField('validatePasswordResetToken', (t) => t.fieldWithInputPayload({
15
+ authorize: ['public'],
16
+ payload: {
17
+ valid: t.payload.field({ type: 'Boolean' }),
18
+ },
19
+ input: {
20
+ token: t.input.field({ required: true, type: 'String' }),
21
+ },
22
+ resolve: async (_root, { input }) => validatePasswordResetToken({ token: input.token }),
23
+ }));
24
+ builder.mutationField('resetPasswordWithToken', (t) => t.fieldWithInputPayload({
25
+ authorize: ['public'],
26
+ payload: {
27
+ success: t.payload.field({ type: 'Boolean' }),
28
+ },
29
+ input: {
30
+ token: t.input.field({ required: true, type: 'String' }),
31
+ newPassword: t.input.field({ required: true, type: 'String' }),
32
+ },
33
+ resolve: async (_root, { input }) => completePasswordReset({
34
+ token: input.token,
35
+ newPassword: input.newPassword,
36
+ }),
37
+ }));
38
+ //# sourceMappingURL=password-reset.mutations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"password-reset.mutations.js","sourceRoot":"","sources":["../../../../../../../../src/local-auth/core/generators/auth-email-password/templates/module/schema/password-reset.mutations.ts"],"names":[],"mappings":"AAAA,cAAc;AAEd,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACpB,0BAA0B,GAC3B,MAAM,wBA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,EAAE,CAAC,CAAC,EAAE,EAAE,CACpD,CAAC,CAAC,qBAAqB,CAAC;IACtB,SAAS,EAAE,CAAC,QAAQ,CAAC;IACrB,OAAO,EAAE;QACP,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;KAC9C;IACD,KAAK,EAAE;QACL,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;QACxD,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;KAC/D;IACD,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,CAClC,qBAAqB,CAAC;QACpB,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,WAAW,EAAE,KAAK,CAAC,WAAW;KAC/B,CAAC;CACL,CAAC,CACH,CAAC"}
@@ -0,0 +1,54 @@
1
+ // @ts-nocheck
2
+
3
+ import {
4
+ completePasswordReset,
5
+ requestPasswordReset,
6
+ validatePasswordResetToken,
7
+ } from '$servicesPasswordReset';
8
+ import { builder } from '%pothosImports';
9
+
10
+ builder.mutationField('requestPasswordReset', (t) =>
11
+ t.fieldWithInputPayload({
12
+ authorize: ['public'],
13
+ payload: {
14
+ success: t.payload.field({ type: 'Boolean' }),
15
+ },
16
+ input: {
17
+ email: t.input.field({ required: true, type: 'String' }),
18
+ },
19
+ resolve: async (_root, { input }, context) =>
20
+ requestPasswordReset({ email: input.email, context }),
21
+ }),
22
+ );
23
+
24
+ builder.mutationField('validatePasswordResetToken', (t) =>
25
+ t.fieldWithInputPayload({
26
+ authorize: ['public'],
27
+ payload: {
28
+ valid: t.payload.field({ type: 'Boolean' }),
29
+ },
30
+ input: {
31
+ token: t.input.field({ required: true, type: 'String' }),
32
+ },
33
+ resolve: async (_root, { input }) =>
34
+ validatePasswordResetToken({ token: input.token }),
35
+ }),
36
+ );
37
+
38
+ builder.mutationField('resetPasswordWithToken', (t) =>
39
+ t.fieldWithInputPayload({
40
+ authorize: ['public'],
41
+ payload: {
42
+ success: t.payload.field({ type: 'Boolean' }),
43
+ },
44
+ input: {
45
+ token: t.input.field({ required: true, type: 'String' }),
46
+ newPassword: t.input.field({ required: true, type: 'String' }),
47
+ },
48
+ resolve: async (_root, { input }) =>
49
+ completePasswordReset({
50
+ token: input.token,
51
+ newPassword: input.newPassword,
52
+ }),
53
+ }),
54
+ );
@@ -0,0 +1,24 @@
1
+ import type { RequestServiceContext } from '%requestServiceContextImports';
2
+ /**
3
+ * Request an email verification for the authenticated user.
4
+ * Sends a verification email with a link to verify.
5
+ */
6
+ export declare function requestEmailVerification({ userId, context, }: {
7
+ userId: string;
8
+ context: RequestServiceContext;
9
+ }): Promise<{
10
+ success: true;
11
+ }>;
12
+ /**
13
+ * Verify a user's email using the token from the verification email.
14
+ * This is a public (anonymous) mutation — the token proves identity.
15
+ *
16
+ * @throws BadRequestError if token is invalid or expired
17
+ */
18
+ export declare function verifyEmail({ token, context, }: {
19
+ token: string;
20
+ context: RequestServiceContext;
21
+ }): Promise<{
22
+ success: true;
23
+ }>;
24
+ //# sourceMappingURL=email-verification.service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"email-verification.service.d.ts","sourceRoot":"","sources":["../../../../../../../../src/local-auth/core/generators/auth-email-password/templates/module/services/email-verification.service.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AA2C3E;;;GAGG;AACH,wBAAsB,wBAAwB,CAAC,EAC7C,MAAM,EACN,OAAO,GACR,EAAE;IACD,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,qBAAqB,CAAC;CAChC,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,IAAI,CAAA;CAAE,CAAC,CA0C7B;AAED;;;;;GAKG;AACH,wBAAsB,WAAW,CAAC,EAChC,KAAK,EACL,OAAO,GACR,EAAE;IACD,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,qBAAqB,CAAC;CAChC,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,IAAI,CAAA;CAAE,CAAC,CA4B7B"}
@@ -0,0 +1,87 @@
1
+ // @ts-nocheck
2
+ import { EMAIL_VERIFICATION_TOKEN_EXPIRY_SEC } from '$constantsPassword';
3
+ import { createAuthVerification, validateAuthVerification, } from '%authModuleImports';
4
+ import { config } from '%configServiceImports';
5
+ import { sendEmail } from '%emailModuleImports';
6
+ import { BadRequestError } from '%errorHandlerServiceImports';
7
+ import { prisma } from '%prismaImports';
8
+ import { memoizeRateLimiter } from '%rateLimitImports';
9
+ const EMAIL_VERIFY_TYPE = 'email-verify';
10
+ /**
11
+ * Rate limiters for email verification operations.
12
+ */
13
+ // Per-user rate limit: 3 requests per 20 minutes
14
+ const getRequestEmailVerificationUserLimiter = memoizeRateLimiter('request-email-verification-user', {
15
+ points: 3,
16
+ duration: 60 * 20, // 20 minutes
17
+ });
18
+ // Per-IP rate limit: 10 requests/hour
19
+ const getRequestEmailVerificationIpLimiter = memoizeRateLimiter('request-email-verification-ip', {
20
+ points: 10,
21
+ duration: 60 * 60, // 1 hour
22
+ });
23
+ // Per-IP rate limit for verify endpoint: 10 requests/hour
24
+ const getVerifyEmailIpLimiter = memoizeRateLimiter('verify-email-ip', {
25
+ points: 10,
26
+ duration: 60 * 60, // 1 hour
27
+ });
28
+ /**
29
+ * Request an email verification for the authenticated user.
30
+ * Sends a verification email with a link to verify.
31
+ */
32
+ export async function requestEmailVerification({ userId, context, }) {
33
+ await Promise.all([
34
+ getRequestEmailVerificationIpLimiter().consumeOrThrow(context.reqInfo.ip, 'Too many verification attempts. Please try again later.', 'too-many-requests'),
35
+ getRequestEmailVerificationUserLimiter().consumeOrThrow(userId, 'Too many verification attempts. Please try again later.', 'too-many-requests'),
36
+ ]);
37
+ const user = await prisma.user.findUnique({
38
+ where: { id: userId },
39
+ select: { id: true, email: true, emailVerified: true },
40
+ });
41
+ if (!user?.email) {
42
+ throw new BadRequestError('No email address on account', 'no-email');
43
+ }
44
+ if (user.emailVerified) {
45
+ return { success: true };
46
+ }
47
+ const { token } = await createAuthVerification({
48
+ type: EMAIL_VERIFY_TYPE,
49
+ userId: user.id,
50
+ expiresInSec: EMAIL_VERIFICATION_TOKEN_EXPIRY_SEC,
51
+ });
52
+ // Construct verification URL using configured domain
53
+ const verifyLink = `${config.AUTH_FRONTEND_URL}/auth/verify-email?token=${encodeURIComponent(token)}`;
54
+ await sendEmail(TPL_ACCOUNT_VERIFICATION_EMAIL, {
55
+ to: user.email,
56
+ data: { verifyLink },
57
+ });
58
+ return { success: true };
59
+ }
60
+ /**
61
+ * Verify a user's email using the token from the verification email.
62
+ * This is a public (anonymous) mutation — the token proves identity.
63
+ *
64
+ * @throws BadRequestError if token is invalid or expired
65
+ */
66
+ export async function verifyEmail({ token, context, }) {
67
+ await getVerifyEmailIpLimiter().consumeOrThrow(context.reqInfo.ip, 'Too many verification attempts. Please try again later.', 'too-many-requests');
68
+ const record = await validateAuthVerification({
69
+ type: EMAIL_VERIFY_TYPE,
70
+ token,
71
+ });
72
+ if (!record?.userId) {
73
+ throw new BadRequestError('Invalid or expired token', 'invalid-token');
74
+ }
75
+ // Delete this token + remaining email-verify tokens + update user in one transaction
76
+ await prisma.$transaction([
77
+ prisma.authVerification.deleteMany({
78
+ where: { type: EMAIL_VERIFY_TYPE, userId: record.userId },
79
+ }),
80
+ prisma.user.update({
81
+ where: { id: record.userId },
82
+ data: { emailVerified: true },
83
+ }),
84
+ ]);
85
+ return { success: true };
86
+ }
87
+ //# sourceMappingURL=email-verification.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"email-verification.service.js","sourceRoot":"","sources":["../../../../../../../../src/local-auth/core/generators/auth-email-password/templates/module/services/email-verification.service.ts"],"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