@baseplate-dev/plugin-auth 4.0.1 → 4.0.2

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 (268) hide show
  1. package/CHANGELOG.md +621 -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 +49 -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 +17 -6
  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 +209 -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 +5 -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 +5 -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 +48 -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 +253 -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 +102 -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/auth-verification.service.d.ts +40 -0
  49. package/dist/local-auth/core/generators/auth-email-password/templates/module/services/auth-verification.service.d.ts.map +1 -0
  50. package/dist/local-auth/core/generators/auth-email-password/templates/module/services/auth-verification.service.js +106 -0
  51. package/dist/local-auth/core/generators/auth-email-password/templates/module/services/auth-verification.service.js.map +1 -0
  52. package/dist/local-auth/core/generators/auth-email-password/templates/module/services/auth-verification.service.ts +146 -0
  53. package/dist/local-auth/core/generators/auth-email-password/templates/module/services/email-verification.service.d.ts +24 -0
  54. package/dist/local-auth/core/generators/auth-email-password/templates/module/services/email-verification.service.d.ts.map +1 -0
  55. package/dist/local-auth/core/generators/auth-email-password/templates/module/services/email-verification.service.js +88 -0
  56. package/dist/local-auth/core/generators/auth-email-password/templates/module/services/email-verification.service.js.map +1 -0
  57. package/dist/local-auth/core/generators/auth-email-password/templates/module/services/email-verification.service.ts +141 -0
  58. package/dist/local-auth/core/generators/auth-email-password/templates/module/services/password-reset.service.d.ts +35 -0
  59. package/dist/local-auth/core/generators/auth-email-password/templates/module/services/password-reset.service.d.ts.map +1 -0
  60. package/dist/local-auth/core/generators/auth-email-password/templates/module/services/password-reset.service.js +157 -0
  61. package/dist/local-auth/core/generators/auth-email-password/templates/module/services/password-reset.service.js.map +1 -0
  62. package/dist/local-auth/core/generators/auth-email-password/templates/module/services/password-reset.service.ts +233 -0
  63. package/dist/local-auth/core/generators/auth-email-password/templates/module/services/user-password.service.d.ts.map +1 -1
  64. package/dist/local-auth/core/generators/auth-email-password/templates/module/services/user-password.service.js +48 -14
  65. package/dist/local-auth/core/generators/auth-email-password/templates/module/services/user-password.service.js.map +1 -1
  66. package/dist/local-auth/core/generators/auth-email-password/templates/module/services/user-password.service.ts +79 -15
  67. package/dist/local-auth/core/generators/auth-email-templates/auth-email-templates.generator.d.ts +43 -0
  68. package/dist/local-auth/core/generators/auth-email-templates/auth-email-templates.generator.d.ts.map +1 -0
  69. package/dist/local-auth/core/generators/auth-email-templates/auth-email-templates.generator.js +48 -0
  70. package/dist/local-auth/core/generators/auth-email-templates/auth-email-templates.generator.js.map +1 -0
  71. package/dist/local-auth/core/generators/auth-email-templates/generated/index.d.ts +96 -0
  72. package/dist/local-auth/core/generators/auth-email-templates/generated/index.d.ts.map +1 -0
  73. package/dist/local-auth/core/generators/auth-email-templates/generated/index.js +11 -0
  74. package/dist/local-auth/core/generators/auth-email-templates/generated/index.js.map +1 -0
  75. package/dist/local-auth/core/generators/auth-email-templates/generated/template-paths.d.ts +14 -0
  76. package/dist/local-auth/core/generators/auth-email-templates/generated/template-paths.d.ts.map +1 -0
  77. package/dist/local-auth/core/generators/auth-email-templates/generated/template-paths.js +26 -0
  78. package/dist/local-auth/core/generators/auth-email-templates/generated/template-paths.js.map +1 -0
  79. package/dist/local-auth/core/generators/auth-email-templates/generated/template-renderers.d.ts +41 -0
  80. package/dist/local-auth/core/generators/auth-email-templates/generated/template-renderers.d.ts.map +1 -0
  81. package/dist/local-auth/core/generators/auth-email-templates/generated/template-renderers.js +59 -0
  82. package/dist/local-auth/core/generators/auth-email-templates/generated/template-renderers.js.map +1 -0
  83. package/dist/local-auth/core/generators/auth-email-templates/generated/typed-templates.d.ts +60 -0
  84. package/dist/local-auth/core/generators/auth-email-templates/generated/typed-templates.d.ts.map +1 -0
  85. package/dist/local-auth/core/generators/auth-email-templates/generated/typed-templates.js +42 -0
  86. package/dist/local-auth/core/generators/auth-email-templates/generated/typed-templates.js.map +1 -0
  87. package/dist/local-auth/core/generators/auth-email-templates/index.d.ts +2 -0
  88. package/dist/local-auth/core/generators/auth-email-templates/index.d.ts.map +1 -0
  89. package/dist/local-auth/core/generators/auth-email-templates/index.js +2 -0
  90. package/dist/local-auth/core/generators/auth-email-templates/index.js.map +1 -0
  91. package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/account-verification.email.d.ts +3 -0
  92. package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/account-verification.email.d.ts.map +1 -0
  93. package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/account-verification.email.js +14 -0
  94. package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/account-verification.email.js.map +1 -0
  95. package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/account-verification.email.tsx +55 -0
  96. package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/password-changed.email.d.ts +3 -0
  97. package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/password-changed.email.d.ts.map +1 -0
  98. package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/password-changed.email.js +12 -0
  99. package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/password-changed.email.js.map +1 -0
  100. package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/password-changed.email.tsx +44 -0
  101. package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/password-reset.email.d.ts +3 -0
  102. package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/password-reset.email.d.ts.map +1 -0
  103. package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/password-reset.email.js +14 -0
  104. package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/password-reset.email.js.map +1 -0
  105. package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/password-reset.email.tsx +55 -0
  106. package/dist/local-auth/core/generators/auth-module/auth-module.generator.d.ts +1 -0
  107. package/dist/local-auth/core/generators/auth-module/auth-module.generator.d.ts.map +1 -1
  108. package/dist/local-auth/core/generators/auth-module/auth-module.generator.js +1 -1
  109. package/dist/local-auth/core/generators/auth-module/auth-module.generator.js.map +1 -1
  110. package/dist/local-auth/core/generators/auth-module/generated/index.d.ts +2 -0
  111. package/dist/local-auth/core/generators/auth-module/generated/index.d.ts.map +1 -1
  112. package/dist/local-auth/core/generators/auth-module/generated/template-renderers.d.ts +1 -0
  113. package/dist/local-auth/core/generators/auth-module/generated/template-renderers.d.ts.map +1 -1
  114. package/dist/local-auth/core/generators/auth-module/generated/typed-templates.d.ts +1 -0
  115. package/dist/local-auth/core/generators/auth-module/generated/typed-templates.d.ts.map +1 -1
  116. package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-session.mutations.js +1 -1
  117. package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-session.mutations.js.map +1 -1
  118. package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-session.mutations.ts +1 -1
  119. package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-session.queries.js +2 -2
  120. package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-session.queries.js.map +1 -1
  121. package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-session.queries.ts +2 -2
  122. package/dist/local-auth/core/generators/auth-routes/auth-routes.generator.d.ts.map +1 -1
  123. package/dist/local-auth/core/generators/auth-routes/auth-routes.generator.js +1 -0
  124. package/dist/local-auth/core/generators/auth-routes/auth-routes.generator.js.map +1 -1
  125. package/dist/local-auth/core/generators/auth-routes/generated/index.d.ts +722 -4
  126. package/dist/local-auth/core/generators/auth-routes/generated/index.d.ts.map +1 -1
  127. package/dist/local-auth/core/generators/auth-routes/generated/index.js +2 -0
  128. package/dist/local-auth/core/generators/auth-routes/generated/index.js.map +1 -1
  129. package/dist/local-auth/core/generators/auth-routes/generated/template-paths.d.ts +4 -0
  130. package/dist/local-auth/core/generators/auth-routes/generated/template-paths.d.ts.map +1 -1
  131. package/dist/local-auth/core/generators/auth-routes/generated/template-paths.js +4 -0
  132. package/dist/local-auth/core/generators/auth-routes/generated/template-paths.js.map +1 -1
  133. package/dist/local-auth/core/generators/auth-routes/generated/template-renderers.d.ts +4 -1
  134. package/dist/local-auth/core/generators/auth-routes/generated/template-renderers.d.ts.map +1 -1
  135. package/dist/local-auth/core/generators/auth-routes/generated/template-renderers.js +14 -0
  136. package/dist/local-auth/core/generators/auth-routes/generated/template-renderers.js.map +1 -1
  137. package/dist/local-auth/core/generators/auth-routes/generated/ts-import-providers.d.ts +21 -0
  138. package/dist/local-auth/core/generators/auth-routes/generated/ts-import-providers.d.ts.map +1 -0
  139. package/dist/local-auth/core/generators/auth-routes/generated/ts-import-providers.js +30 -0
  140. package/dist/local-auth/core/generators/auth-routes/generated/ts-import-providers.js.map +1 -0
  141. package/dist/local-auth/core/generators/auth-routes/generated/typed-templates.d.ts +1216 -34
  142. package/dist/local-auth/core/generators/auth-routes/generated/typed-templates.d.ts.map +1 -1
  143. package/dist/local-auth/core/generators/auth-routes/generated/typed-templates.js +70 -2
  144. package/dist/local-auth/core/generators/auth-routes/generated/typed-templates.js.map +1 -1
  145. package/dist/local-auth/core/generators/auth-routes/index.d.ts +2 -0
  146. package/dist/local-auth/core/generators/auth-routes/index.d.ts.map +1 -1
  147. package/dist/local-auth/core/generators/auth-routes/index.js +1 -0
  148. package/dist/local-auth/core/generators/auth-routes/index.js.map +1 -1
  149. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/-constants.d.ts +10 -0
  150. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/-constants.d.ts.map +1 -0
  151. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/-constants.js +11 -0
  152. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/-constants.js.map +1 -0
  153. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/-constants.ts +12 -0
  154. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/forgot-password.d.ts +2 -0
  155. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/forgot-password.d.ts.map +1 -0
  156. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/forgot-password.js +60 -0
  157. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/forgot-password.js.map +1 -0
  158. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/forgot-password.tsx +127 -0
  159. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/login.d.ts +1 -1
  160. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/login.d.ts.map +1 -1
  161. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/login.js +6 -11
  162. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/login.js.map +1 -1
  163. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/login.tsx +20 -19
  164. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/register.d.ts +1 -1
  165. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/register.d.ts.map +1 -1
  166. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/register.js +2 -2
  167. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/register.js.map +1 -1
  168. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/register.tsx +2 -3
  169. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/reset-password.d.ts +7 -0
  170. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/reset-password.d.ts.map +1 -0
  171. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/reset-password.js +131 -0
  172. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/reset-password.js.map +1 -0
  173. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/reset-password.tsx +240 -0
  174. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/verify-email.d.ts +7 -0
  175. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/verify-email.d.ts.map +1 -0
  176. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/verify-email.js +106 -0
  177. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/verify-email.js.map +1 -0
  178. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/verify-email.tsx +206 -0
  179. package/dist/local-auth/core/generators/index.d.ts +1 -0
  180. package/dist/local-auth/core/generators/index.d.ts.map +1 -1
  181. package/dist/local-auth/core/generators/index.js +1 -0
  182. package/dist/local-auth/core/generators/index.js.map +1 -1
  183. package/dist/local-auth/core/generators/seed-initial-user/generated/index.d.ts +12 -0
  184. package/dist/local-auth/core/generators/seed-initial-user/generated/index.d.ts.map +1 -1
  185. package/dist/local-auth/core/generators/seed-initial-user/generated/template-renderers.d.ts +6 -0
  186. package/dist/local-auth/core/generators/seed-initial-user/generated/template-renderers.d.ts.map +1 -1
  187. package/dist/local-auth/core/generators/seed-initial-user/generated/typed-templates.d.ts +6 -0
  188. package/dist/local-auth/core/generators/seed-initial-user/generated/typed-templates.d.ts.map +1 -1
  189. package/dist/local-auth/core/generators/seed-initial-user/seed-initial-user.generator.d.ts +6 -0
  190. package/dist/local-auth/core/generators/seed-initial-user/seed-initial-user.generator.d.ts.map +1 -1
  191. package/dist/local-auth/core/generators/seed-initial-user/seed-initial-user.generator.js +1 -1
  192. package/dist/local-auth/core/generators/seed-initial-user/seed-initial-user.generator.js.map +1 -1
  193. package/dist/local-auth/core/node.d.ts.map +1 -1
  194. package/dist/local-auth/core/node.js +11 -1
  195. package/dist/local-auth/core/node.js.map +1 -1
  196. package/dist/local-auth/core/schema/models.d.ts.map +1 -1
  197. package/dist/local-auth/core/schema/models.js +60 -0
  198. package/dist/local-auth/core/schema/models.js.map +1 -1
  199. package/dist/placeholder-auth/core/schema/plugin-definition.js +1 -1
  200. package/dist/placeholder-auth/core/schema/plugin-definition.js.map +1 -1
  201. package/dist/web/assets/{__federation_expose_auth0CoreCommon-DLSGXjCI.js → __federation_expose_auth0CoreCommon-DKJVe6Rd.js} +3 -3
  202. package/dist/web/assets/{__federation_expose_auth0CoreCommon-DLSGXjCI.js.map → __federation_expose_auth0CoreCommon-DKJVe6Rd.js.map} +1 -1
  203. package/dist/web/assets/{__federation_expose_auth0CoreWeb-C7FfhlmF.js → __federation_expose_auth0CoreWeb-CfhSWZsK.js} +5 -5
  204. package/dist/web/assets/{__federation_expose_auth0CoreWeb-C7FfhlmF.js.map → __federation_expose_auth0CoreWeb-CfhSWZsK.js.map} +1 -1
  205. package/dist/web/assets/{__federation_expose_authCoreCommon-BF58isGa.js → __federation_expose_authCoreCommon-D3-Gk9mI.js} +3 -3
  206. package/dist/web/assets/{__federation_expose_authCoreCommon-BF58isGa.js.map → __federation_expose_authCoreCommon-D3-Gk9mI.js.map} +1 -1
  207. package/dist/web/assets/{__federation_expose_authCoreWeb-DMq9M88g.js → __federation_expose_authCoreWeb-DZoAij9e.js} +6 -6
  208. package/dist/web/assets/{__federation_expose_authCoreWeb-DMq9M88g.js.map → __federation_expose_authCoreWeb-DZoAij9e.js.map} +1 -1
  209. package/dist/web/assets/{__federation_expose_local-authAdminCommon-sQw4q5YX.js → __federation_expose_local-authAdminCommon-BRHnF0Hn.js} +2 -2
  210. package/dist/web/assets/{__federation_expose_local-authAdminCommon-sQw4q5YX.js.map → __federation_expose_local-authAdminCommon-BRHnF0Hn.js.map} +1 -1
  211. package/dist/web/assets/{__federation_expose_local-authAdminWeb-9FbO89NR.js → __federation_expose_local-authAdminWeb-dYAIxuqC.js} +3 -3
  212. package/dist/web/assets/{__federation_expose_local-authAdminWeb-9FbO89NR.js.map → __federation_expose_local-authAdminWeb-dYAIxuqC.js.map} +1 -1
  213. package/dist/web/assets/{__federation_expose_local-authCoreCommon-CpUK09_4.js → __federation_expose_local-authCoreCommon-CIwvOx0d.js} +4 -4
  214. package/dist/web/assets/{__federation_expose_local-authCoreCommon-CpUK09_4.js.map → __federation_expose_local-authCoreCommon-CIwvOx0d.js.map} +1 -1
  215. package/dist/web/assets/{__federation_expose_local-authCoreWeb-Czp0GaY1.js → __federation_expose_local-authCoreWeb-Bwooi2qZ.js} +66 -6
  216. package/dist/web/assets/__federation_expose_local-authCoreWeb-Bwooi2qZ.js.map +1 -0
  217. package/dist/web/assets/{__federation_expose_placeholder-authCoreCommon-CFDDdOMo.js → __federation_expose_placeholder-authCoreCommon-gFDSzGjB.js} +3 -3
  218. package/dist/web/assets/{__federation_expose_placeholder-authCoreCommon-CFDDdOMo.js.map → __federation_expose_placeholder-authCoreCommon-gFDSzGjB.js.map} +1 -1
  219. package/dist/web/assets/{__federation_expose_placeholder-authCoreWeb-Bcn1_oDP.js → __federation_expose_placeholder-authCoreWeb-BZLwIkLk.js} +5 -5
  220. package/dist/web/assets/{__federation_expose_placeholder-authCoreWeb-Bcn1_oDP.js.map → __federation_expose_placeholder-authCoreWeb-BZLwIkLk.js.map} +1 -1
  221. package/dist/web/assets/{__federation_fn_import-DsXcpNlB.js → __federation_fn_import-pxYUpmb_.js} +2 -2
  222. package/dist/web/assets/{__federation_fn_import-DsXcpNlB.js.map → __federation_fn_import-pxYUpmb_.js.map} +1 -1
  223. package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib/{web-zqe3PPcn.js → web-BXi2UCP-.js} +7 -7
  224. package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib/web-BXi2UCP-.js.map +1 -0
  225. package/dist/web/assets/__federation_shared_@baseplate-dev/{project-builder-lib-CmgMfkI5.js → project-builder-lib-O0clDXMb.js} +7137 -136
  226. package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib-O0clDXMb.js.map +1 -0
  227. package/dist/web/assets/__federation_shared_@baseplate-dev/ui-components-BpuFQk6s.js +52536 -0
  228. package/dist/web/assets/__federation_shared_@baseplate-dev/ui-components-BpuFQk6s.js.map +1 -0
  229. package/dist/web/assets/__federation_shared_@baseplate-dev/{utils-BO5VHrCf.js → utils-UiZ-8JBg.js} +5 -6
  230. package/dist/web/assets/__federation_shared_@baseplate-dev/utils-UiZ-8JBg.js.map +1 -0
  231. package/dist/web/assets/__federation_shared_@tanstack/{react-router-CNzDweD5.js → react-router-BPEAtEJI.js} +1069 -746
  232. package/dist/web/assets/__federation_shared_@tanstack/react-router-BPEAtEJI.js.map +1 -0
  233. package/dist/web/assets/{get-auth-plugin-definition-BV2O8wTa.js → get-auth-plugin-definition-DPsrvQbo.js} +2 -2
  234. package/dist/web/assets/{get-auth-plugin-definition-BV2O8wTa.js.map → get-auth-plugin-definition-DPsrvQbo.js.map} +1 -1
  235. package/dist/web/assets/{index-BL7fotl7.js → index-CSfs0UAV.js} +2 -2
  236. package/dist/web/assets/{index-BL7fotl7.js.map → index-CSfs0UAV.js.map} +1 -1
  237. package/dist/web/assets/{index.esm-B4RpOlq_.js → index.esm-BoRQu8mM.js} +2 -2
  238. package/dist/web/assets/{index.esm-B4RpOlq_.js.map → index.esm-BoRQu8mM.js.map} +1 -1
  239. package/dist/web/assets/{model-merger-BwRNqcBu.js → model-merger-CdjliK9v.js} +80 -23
  240. package/dist/web/assets/model-merger-CdjliK9v.js.map +1 -0
  241. package/dist/web/assets/{model-names-CEoSIalq.js → model-names-DrcaRxt1.js} +6 -2
  242. package/dist/web/assets/{model-names-CEoSIalq.js.map → model-names-DrcaRxt1.js.map} +1 -1
  243. package/dist/web/assets/{plugin-definition-CHD5r-h7.js → plugin-definition-BG6tu7Hh.js} +3 -3
  244. package/dist/web/assets/plugin-definition-BG6tu7Hh.js.map +1 -0
  245. package/dist/web/assets/{plugin-definition-DA9rJBcS.js → plugin-definition-BMYDEj3f.js} +3 -3
  246. package/dist/web/assets/plugin-definition-BMYDEj3f.js.map +1 -0
  247. package/dist/web/assets/{plugin-definition-B9d2CoQL.js → plugin-definition-DRhTuQas.js} +2 -2
  248. package/dist/web/assets/{plugin-definition-B9d2CoQL.js.map → plugin-definition-DRhTuQas.js.map} +1 -1
  249. package/dist/web/assets/{plugin-definition-BMTsmwyH.js → plugin-definition-j1nJ0FFI.js} +2 -2
  250. package/dist/web/assets/{plugin-definition-BMTsmwyH.js.map → plugin-definition-j1nJ0FFI.js.map} +1 -1
  251. package/dist/web/assets/{react-B9vhIZMy.js → react-CBhSWxr_.js} +2 -2
  252. package/dist/web/assets/{react-B9vhIZMy.js.map → react-CBhSWxr_.js.map} +1 -1
  253. package/dist/web/assets/remoteEntry.js +20 -20
  254. package/dist/web/assets/{style-DZ-aOCkd.css → style-DiK_rD1L.css} +1 -1
  255. package/dist/web/assets/{styles-CEm5K1iU.js → styles-BbHyE-2h.js} +3 -3
  256. package/dist/web/assets/{styles-CEm5K1iU.js.map → styles-BbHyE-2h.js.map} +1 -1
  257. package/dist/web/index.html +1 -1
  258. package/package.json +21 -19
  259. package/dist/web/assets/__federation_expose_local-authCoreWeb-Czp0GaY1.js.map +0 -1
  260. package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib/web-zqe3PPcn.js.map +0 -1
  261. package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib-CmgMfkI5.js.map +0 -1
  262. package/dist/web/assets/__federation_shared_@baseplate-dev/ui-components-D1Dayhn9.js +0 -24082
  263. package/dist/web/assets/__federation_shared_@baseplate-dev/ui-components-D1Dayhn9.js.map +0 -1
  264. package/dist/web/assets/__federation_shared_@baseplate-dev/utils-BO5VHrCf.js.map +0 -1
  265. package/dist/web/assets/__federation_shared_@tanstack/react-router-CNzDweD5.js.map +0 -1
  266. package/dist/web/assets/model-merger-BwRNqcBu.js.map +0 -1
  267. package/dist/web/assets/plugin-definition-CHD5r-h7.js.map +0 -1
  268. package/dist/web/assets/plugin-definition-DA9rJBcS.js.map +0 -1
@@ -0,0 +1,7 @@
1
+ import { z } from 'zod';
2
+ export declare const Route: import("@tanstack/router-core").Route<import("@tanstack/react-router").Register, never, never, never, never, never, z.ZodObject<{
3
+ token: z.ZodOptional<z.ZodString>;
4
+ }, z.core.$strip>, import("@tanstack/react-router").ResolveParams<never>, import("@tanstack/react-router").AnyContext, import("@tanstack/react-router").AnyContext, ({ search: { token }, context: { userId } }: import("@tanstack/react-router").BeforeLoadContextOptions<import("@tanstack/react-router").Register, never, z.ZodObject<{
5
+ token: z.ZodOptional<z.ZodString>;
6
+ }, z.core.$strip>, import("@tanstack/react-router").ResolveParams<never>, import("@tanstack/react-router").AnyContext, import("@tanstack/react-router").AnyContext, never, unknown, undefined>) => void, {}, undefined, unknown, unknown, unknown, unknown, undefined>;
7
+ //# sourceMappingURL=reset-password.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reset-password.d.ts","sourceRoot":"","sources":["../../../../../../../../src/local-auth/core/generators/auth-routes/templates/routes/auth_/reset-password.tsx"],"names":[],"mappings":"AA0BA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,KAAK;;;;sQAahB,CAAC"}
@@ -0,0 +1,131 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ // @ts-nocheck
3
+ import { PASSWORD_MAX_LENGTH, PASSWORD_MIN_LENGTH } from '$constants';
4
+ import { getApolloErrorCode } from '%apolloErrorImports';
5
+ import { graphql } from '%graphqlImports';
6
+ import { Button, Card, CardContent, CardDescription, CardHeader, CardTitle, InputFieldController, } from '%reactComponentsImports';
7
+ import { logAndFormatError, logError } from '%reactErrorImports';
8
+ import { useMutation } from '@apollo/client/react';
9
+ import { zodResolver } from '@hookform/resolvers/zod';
10
+ import { createFileRoute, Link, redirect, useNavigate, } from '@tanstack/react-router';
11
+ import { useEffect, useState } from 'react';
12
+ import { useForm } from 'react-hook-form';
13
+ import { toast } from 'sonner';
14
+ import { z } from 'zod';
15
+ export const Route = createFileRoute('/auth_/reset-password')({
16
+ validateSearch: z.object({
17
+ token: z.string().optional(),
18
+ }),
19
+ component: ResetPasswordPage,
20
+ beforeLoad: ({ search: { token }, context: { userId } }) => {
21
+ if (userId) {
22
+ throw redirect({ to: '/' });
23
+ }
24
+ if (!token) {
25
+ throw redirect({ to: '/auth/forgot-password' });
26
+ }
27
+ },
28
+ });
29
+ const formSchema = z
30
+ .object({
31
+ newPassword: z.string().min(PASSWORD_MIN_LENGTH).max(PASSWORD_MAX_LENGTH),
32
+ confirmPassword: z
33
+ .string()
34
+ .min(PASSWORD_MIN_LENGTH)
35
+ .max(PASSWORD_MAX_LENGTH),
36
+ })
37
+ .refine((data) => data.newPassword === data.confirmPassword, {
38
+ message: 'Passwords do not match',
39
+ path: ['confirmPassword'],
40
+ });
41
+ const validateTokenMutation = graphql(`
42
+ mutation ValidatePasswordResetToken(
43
+ $input: ValidatePasswordResetTokenInput!
44
+ ) {
45
+ validatePasswordResetToken(input: $input) {
46
+ valid
47
+ }
48
+ }
49
+ `);
50
+ const resetPasswordMutation = graphql(`
51
+ mutation ResetPasswordWithToken($input: ResetPasswordWithTokenInput!) {
52
+ resetPasswordWithToken(input: $input) {
53
+ success
54
+ }
55
+ }
56
+ `);
57
+ function ResetPasswordPage() {
58
+ const { token } = Route.useSearch();
59
+ const navigate = useNavigate();
60
+ const [tokenValid, setTokenValid] = useState(null);
61
+ const [resetComplete, setResetComplete] = useState(false);
62
+ const [validateToken] = useMutation(validateTokenMutation);
63
+ const [resetPassword, { loading }] = useMutation(resetPasswordMutation);
64
+ const { control, handleSubmit } = useForm({
65
+ resolver: zodResolver(formSchema),
66
+ reValidateMode: 'onBlur',
67
+ });
68
+ // Validate token on mount
69
+ useEffect(() => {
70
+ if (token) {
71
+ validateToken({
72
+ variables: { input: { token } },
73
+ })
74
+ .then(({ data }) => {
75
+ setTokenValid(data?.validatePasswordResetToken.valid ?? false);
76
+ })
77
+ .catch(() => {
78
+ setTokenValid(false);
79
+ });
80
+ }
81
+ }, [token, validateToken]);
82
+ const onSubmit = (data) => {
83
+ if (!token)
84
+ return;
85
+ resetPassword({
86
+ variables: {
87
+ input: {
88
+ token,
89
+ newPassword: data.newPassword,
90
+ },
91
+ },
92
+ })
93
+ .then(() => {
94
+ setResetComplete(true);
95
+ toast.success('Password reset successful!');
96
+ })
97
+ .catch((err) => {
98
+ const errorCode = getApolloErrorCode(err, [
99
+ 'invalid-token',
100
+ 'token-expired',
101
+ ]);
102
+ switch (errorCode) {
103
+ case 'invalid-token':
104
+ case 'token-expired': {
105
+ setTokenValid(false);
106
+ break;
107
+ }
108
+ default: {
109
+ toast.error(logAndFormatError(err, 'Sorry, we could not reset your password.'));
110
+ }
111
+ }
112
+ });
113
+ };
114
+ // Loading state
115
+ if (tokenValid === null) {
116
+ return (_jsx(Card, { children: _jsxs(CardHeader, { children: [_jsx(CardTitle, { children: "Validating..." }), _jsx(CardDescription, { children: "Please wait while we verify your reset link." })] }) }));
117
+ }
118
+ // Invalid token state
119
+ if (!tokenValid) {
120
+ return (_jsxs(Card, { children: [_jsxs(CardHeader, { children: [_jsx(CardTitle, { children: "Invalid or Expired Link" }), _jsx(CardDescription, { children: "This password reset link is invalid or has expired. Please request a new one." })] }), _jsx(CardContent, { children: _jsx(Link, { to: "/auth/forgot-password", children: _jsx(Button, { variant: "secondary", className: "w-full", children: "Request New Link" }) }) })] }));
121
+ }
122
+ // Success state - redirect to login
123
+ if (resetComplete) {
124
+ return (_jsxs(Card, { children: [_jsxs(CardHeader, { children: [_jsx(CardTitle, { children: "Password Reset Complete" }), _jsx(CardDescription, { children: "Your password has been successfully reset. You can now log in with your new password." })] }), _jsx(CardContent, { children: _jsx(Button, { variant: "secondary", className: "w-full", onClick: () => {
125
+ navigate({ to: '/auth/login' }).catch(logError);
126
+ }, children: "Go to Login" }) })] }));
127
+ }
128
+ // Reset form
129
+ return (_jsxs(Card, { children: [_jsxs(CardHeader, { children: [_jsx(CardTitle, { children: "Reset your password" }), _jsx(CardDescription, { children: "Enter your new password below." })] }), _jsx(CardContent, { children: _jsx("form", { onSubmit: handleSubmit(onSubmit), children: _jsxs("div", { className: "flex flex-col gap-6", children: [_jsx(InputFieldController, { control: control, name: "newPassword", label: "New Password", type: "password", autoComplete: "new-password", placeholder: "Enter new password" }), _jsx(InputFieldController, { control: control, name: "confirmPassword", label: "Confirm Password", type: "password", autoComplete: "new-password", placeholder: "Confirm new password" }), _jsx(Button, { type: "submit", className: "w-full", disabled: loading, children: "Reset Password" })] }) }) })] }));
130
+ }
131
+ //# sourceMappingURL=reset-password.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reset-password.js","sourceRoot":"","sources":["../../../../../../../../src/local-auth/core/generators/auth-routes/templates/routes/auth_/reset-password.tsx"],"names":[],"mappings":";AA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,EAAC,qBAAqB,aAClC,KAAC,oBAAoB,IACnB,OAAO,EAAE,OAAO,EAChB,IAAI,EAAC,aAAa,EAClB,KAAK,EAAC,cAAc,EACpB,IAAI,EAAC,UAAU,EACf,YAAY,EAAC,cAAc,EAC3B,WAAW,EAAC,oBAAoB,GAChC,EACF,KAAC,oBAAoB,IACnB,OAAO,EAAE,OAAO,EAChB,IAAI,EAAC,iBAAiB,EACtB,KAAK,EAAC,kBAAkB,EACxB,IAAI,EAAC,UAAU,EACf,YAAY,EAAC,cAAc,EAC3B,WAAW,EAAC,sBAAsB,GAClC,EACF,KAAC,MAAM,IAAC,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAC,QAAQ,EAAC,QAAQ,EAAE,OAAO,+BAEjD,IACL,GACD,GACK,IACT,CACR,CAAC;AACJ,CAAC"}
@@ -0,0 +1,240 @@
1
+ // @ts-nocheck
2
+
3
+ import { PASSWORD_MAX_LENGTH, PASSWORD_MIN_LENGTH } from '$constants';
4
+ import { getApolloErrorCode } from '%apolloErrorImports';
5
+ import { graphql } from '%graphqlImports';
6
+ import {
7
+ Button,
8
+ Card,
9
+ CardContent,
10
+ CardDescription,
11
+ CardHeader,
12
+ CardTitle,
13
+ InputFieldController,
14
+ } from '%reactComponentsImports';
15
+ import { logAndFormatError, logError } from '%reactErrorImports';
16
+ import { useMutation } from '@apollo/client/react';
17
+ import { zodResolver } from '@hookform/resolvers/zod';
18
+ import {
19
+ createFileRoute,
20
+ Link,
21
+ redirect,
22
+ useNavigate,
23
+ } from '@tanstack/react-router';
24
+ import { useEffect, useState } from 'react';
25
+ import { useForm } from 'react-hook-form';
26
+ import { toast } from 'sonner';
27
+ import { z } from 'zod';
28
+
29
+ export const Route = createFileRoute('/auth_/reset-password')({
30
+ validateSearch: z.object({
31
+ token: z.string().optional(),
32
+ }),
33
+ component: ResetPasswordPage,
34
+ beforeLoad: ({ search: { token }, context: { userId } }) => {
35
+ if (userId) {
36
+ throw redirect({ to: '/' });
37
+ }
38
+ if (!token) {
39
+ throw redirect({ to: '/auth/forgot-password' });
40
+ }
41
+ },
42
+ });
43
+
44
+ const formSchema = z
45
+ .object({
46
+ newPassword: z.string().min(PASSWORD_MIN_LENGTH).max(PASSWORD_MAX_LENGTH),
47
+ confirmPassword: z
48
+ .string()
49
+ .min(PASSWORD_MIN_LENGTH)
50
+ .max(PASSWORD_MAX_LENGTH),
51
+ })
52
+ .refine((data) => data.newPassword === data.confirmPassword, {
53
+ message: 'Passwords do not match',
54
+ path: ['confirmPassword'],
55
+ });
56
+
57
+ type FormData = z.infer<typeof formSchema>;
58
+
59
+ const validateTokenMutation = graphql(`
60
+ mutation ValidatePasswordResetToken(
61
+ $input: ValidatePasswordResetTokenInput!
62
+ ) {
63
+ validatePasswordResetToken(input: $input) {
64
+ valid
65
+ }
66
+ }
67
+ `);
68
+
69
+ const resetPasswordMutation = graphql(`
70
+ mutation ResetPasswordWithToken($input: ResetPasswordWithTokenInput!) {
71
+ resetPasswordWithToken(input: $input) {
72
+ success
73
+ }
74
+ }
75
+ `);
76
+
77
+ function ResetPasswordPage(): React.JSX.Element {
78
+ const { token } = Route.useSearch();
79
+ const navigate = useNavigate();
80
+ const [tokenValid, setTokenValid] = useState<boolean | null>(null);
81
+ const [resetComplete, setResetComplete] = useState(false);
82
+
83
+ const [validateToken] = useMutation(validateTokenMutation);
84
+ const [resetPassword, { loading }] = useMutation(resetPasswordMutation);
85
+
86
+ const { control, handleSubmit } = useForm<FormData>({
87
+ resolver: zodResolver(formSchema),
88
+ reValidateMode: 'onBlur',
89
+ });
90
+
91
+ // Validate token on mount
92
+ useEffect(() => {
93
+ if (token) {
94
+ validateToken({
95
+ variables: { input: { token } },
96
+ })
97
+ .then(({ data }) => {
98
+ setTokenValid(data?.validatePasswordResetToken.valid ?? false);
99
+ })
100
+ .catch(() => {
101
+ setTokenValid(false);
102
+ });
103
+ }
104
+ }, [token, validateToken]);
105
+
106
+ const onSubmit = (data: FormData): void => {
107
+ if (!token) return;
108
+
109
+ resetPassword({
110
+ variables: {
111
+ input: {
112
+ token,
113
+ newPassword: data.newPassword,
114
+ },
115
+ },
116
+ })
117
+ .then(() => {
118
+ setResetComplete(true);
119
+ toast.success('Password reset successful!');
120
+ })
121
+ .catch((err: unknown) => {
122
+ const errorCode = getApolloErrorCode(err, [
123
+ 'invalid-token',
124
+ 'token-expired',
125
+ ] as const);
126
+ switch (errorCode) {
127
+ case 'invalid-token':
128
+ case 'token-expired': {
129
+ setTokenValid(false);
130
+ break;
131
+ }
132
+ default: {
133
+ toast.error(
134
+ logAndFormatError(
135
+ err,
136
+ 'Sorry, we could not reset your password.',
137
+ ),
138
+ );
139
+ }
140
+ }
141
+ });
142
+ };
143
+
144
+ // Loading state
145
+ if (tokenValid === null) {
146
+ return (
147
+ <Card>
148
+ <CardHeader>
149
+ <CardTitle>Validating...</CardTitle>
150
+ <CardDescription>
151
+ Please wait while we verify your reset link.
152
+ </CardDescription>
153
+ </CardHeader>
154
+ </Card>
155
+ );
156
+ }
157
+
158
+ // Invalid token state
159
+ if (!tokenValid) {
160
+ return (
161
+ <Card>
162
+ <CardHeader>
163
+ <CardTitle>Invalid or Expired Link</CardTitle>
164
+ <CardDescription>
165
+ This password reset link is invalid or has expired. Please request a
166
+ new one.
167
+ </CardDescription>
168
+ </CardHeader>
169
+ <CardContent>
170
+ <Link to="/auth/forgot-password">
171
+ <Button variant="secondary" className="w-full">
172
+ Request New Link
173
+ </Button>
174
+ </Link>
175
+ </CardContent>
176
+ </Card>
177
+ );
178
+ }
179
+
180
+ // Success state - redirect to login
181
+ if (resetComplete) {
182
+ return (
183
+ <Card>
184
+ <CardHeader>
185
+ <CardTitle>Password Reset Complete</CardTitle>
186
+ <CardDescription>
187
+ Your password has been successfully reset. You can now log in with
188
+ your new password.
189
+ </CardDescription>
190
+ </CardHeader>
191
+ <CardContent>
192
+ <Button
193
+ variant="secondary"
194
+ className="w-full"
195
+ onClick={() => {
196
+ navigate({ to: '/auth/login' }).catch(logError);
197
+ }}
198
+ >
199
+ Go to Login
200
+ </Button>
201
+ </CardContent>
202
+ </Card>
203
+ );
204
+ }
205
+
206
+ // Reset form
207
+ return (
208
+ <Card>
209
+ <CardHeader>
210
+ <CardTitle>Reset your password</CardTitle>
211
+ <CardDescription>Enter your new password below.</CardDescription>
212
+ </CardHeader>
213
+ <CardContent>
214
+ <form onSubmit={handleSubmit(onSubmit)}>
215
+ <div className="flex flex-col gap-6">
216
+ <InputFieldController
217
+ control={control}
218
+ name="newPassword"
219
+ label="New Password"
220
+ type="password"
221
+ autoComplete="new-password"
222
+ placeholder="Enter new password"
223
+ />
224
+ <InputFieldController
225
+ control={control}
226
+ name="confirmPassword"
227
+ label="Confirm Password"
228
+ type="password"
229
+ autoComplete="new-password"
230
+ placeholder="Confirm new password"
231
+ />
232
+ <Button type="submit" className="w-full" disabled={loading}>
233
+ Reset Password
234
+ </Button>
235
+ </div>
236
+ </form>
237
+ </CardContent>
238
+ </Card>
239
+ );
240
+ }
@@ -0,0 +1,7 @@
1
+ import { z } from 'zod';
2
+ export declare const Route: import("@tanstack/router-core").Route<import("@tanstack/react-router").Register, never, never, never, never, never, z.ZodObject<{
3
+ token: z.ZodOptional<z.ZodString>;
4
+ }, z.core.$strip>, import("@tanstack/react-router").ResolveParams<never>, import("@tanstack/react-router").AnyContext, import("@tanstack/react-router").AnyContext, ({ search: { token } }: import("@tanstack/react-router").BeforeLoadContextOptions<import("@tanstack/react-router").Register, never, z.ZodObject<{
5
+ token: z.ZodOptional<z.ZodString>;
6
+ }, z.core.$strip>, import("@tanstack/react-router").ResolveParams<never>, import("@tanstack/react-router").AnyContext, import("@tanstack/react-router").AnyContext, never, unknown, undefined>) => void, {}, undefined, unknown, unknown, unknown, unknown, undefined>;
7
+ //# sourceMappingURL=verify-email.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"verify-email.d.ts","sourceRoot":"","sources":["../../../../../../../../src/local-auth/core/generators/auth-routes/templates/routes/auth_/verify-email.tsx"],"names":[],"mappings":"AAiBA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,KAAK;;;;sQAUhB,CAAC"}
@@ -0,0 +1,106 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ // @ts-nocheck
3
+ import { getApolloErrorCode } from '%apolloErrorImports';
4
+ import { graphql } from '%graphqlImports';
5
+ import { Button, Card, CardContent, CardDescription, CardHeader, CardTitle, } from '%reactComponentsImports';
6
+ import { logAndFormatError, logError } from '%reactErrorImports';
7
+ import { useMutation } from '@apollo/client/react';
8
+ import { createFileRoute, redirect, useNavigate } from '@tanstack/react-router';
9
+ import { useCallback, useEffect, useState } from 'react';
10
+ import { toast } from 'sonner';
11
+ import { z } from 'zod';
12
+ export const Route = createFileRoute('/auth_/verify-email')({
13
+ validateSearch: z.object({
14
+ token: z.string().optional(),
15
+ }),
16
+ component: VerifyEmailPage,
17
+ beforeLoad: ({ search: { token } }) => {
18
+ if (!token) {
19
+ throw redirect({ to: '/' });
20
+ }
21
+ },
22
+ });
23
+ const verifyEmailMutation = graphql(`
24
+ mutation VerifyEmail($input: VerifyEmailInput!) {
25
+ verifyEmail(input: $input) {
26
+ success
27
+ }
28
+ }
29
+ `);
30
+ const requestEmailVerificationMutation = graphql(`
31
+ mutation RequestEmailVerification {
32
+ requestEmailVerification {
33
+ success
34
+ }
35
+ }
36
+ `);
37
+ function VerifyEmailPage() {
38
+ const { token } = Route.useSearch();
39
+ const { userId } = Route.useRouteContext();
40
+ const navigate = useNavigate();
41
+ const [status, setStatus] = useState(userId ? 'verifying' : 'idle');
42
+ const [verifyEmail] = useMutation(verifyEmailMutation);
43
+ const [requestVerification, { loading: resending }] = useMutation(requestEmailVerificationMutation);
44
+ const doVerify = useCallback(() => {
45
+ if (!token)
46
+ return;
47
+ setStatus('verifying');
48
+ verifyEmail({
49
+ variables: { input: { token } },
50
+ })
51
+ .then(() => {
52
+ setStatus('success');
53
+ })
54
+ .catch((err) => {
55
+ const errorCode = getApolloErrorCode(err, [
56
+ 'invalid-token',
57
+ 'token-expired',
58
+ ]);
59
+ switch (errorCode) {
60
+ case 'invalid-token':
61
+ case 'token-expired': {
62
+ setStatus('error');
63
+ break;
64
+ }
65
+ default: {
66
+ toast.error(logAndFormatError(err, 'Sorry, we could not verify your email.'));
67
+ setStatus('error');
68
+ }
69
+ }
70
+ });
71
+ }, [token, verifyEmail]);
72
+ // If logged in, auto-verify on mount
73
+ useEffect(() => {
74
+ if (userId && token) {
75
+ doVerify();
76
+ }
77
+ }, [userId, token, doVerify]);
78
+ const handleResend = () => {
79
+ requestVerification()
80
+ .then(() => {
81
+ toast.success('Verification email sent! Check your inbox.');
82
+ })
83
+ .catch((err) => {
84
+ toast.error(logAndFormatError(err, 'Could not resend verification email.'));
85
+ });
86
+ };
87
+ // Verifying state
88
+ if (status === 'verifying') {
89
+ return (_jsx(Card, { children: _jsxs(CardHeader, { children: [_jsx(CardTitle, { children: "Verifying..." }), _jsx(CardDescription, { children: "Please wait while we verify your email address." })] }) }));
90
+ }
91
+ // Success state
92
+ if (status === 'success') {
93
+ return (_jsxs(Card, { children: [_jsxs(CardHeader, { children: [_jsx(CardTitle, { children: "Email Verified!" }), _jsx(CardDescription, { children: "Your email address has been successfully verified." })] }), _jsx(CardContent, { children: _jsx(Button, { variant: "secondary", className: "w-full", onClick: () => {
94
+ navigate({ to: '/' }).catch(logError);
95
+ }, children: "Continue" }) })] }));
96
+ }
97
+ // Error state
98
+ if (status === 'error') {
99
+ return (_jsxs(Card, { children: [_jsxs(CardHeader, { children: [_jsx(CardTitle, { children: "Invalid or Expired Link" }), _jsx(CardDescription, { children: "This verification link is invalid or has expired." })] }), _jsx(CardContent, { children: _jsx("div", { className: "flex flex-col gap-3", children: userId ? (_jsx(Button, { variant: "secondary", className: "w-full", disabled: resending, onClick: handleResend, children: "Resend Verification Email" })) : (_jsx(Button, { variant: "secondary", className: "w-full", onClick: () => {
100
+ navigate({ to: '/auth/login' }).catch(logError);
101
+ }, children: "Log In to Resend" })) }) })] }));
102
+ }
103
+ // Idle state (not logged in) — show button to verify
104
+ return (_jsxs(Card, { children: [_jsxs(CardHeader, { children: [_jsx(CardTitle, { children: "Verify your email" }), _jsx(CardDescription, { children: "Click the button below to verify your email address." })] }), _jsx(CardContent, { children: _jsx(Button, { className: "w-full", onClick: doVerify, children: "Verify Email" }) })] }));
105
+ }
106
+ //# sourceMappingURL=verify-email.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"verify-email.js","sourceRoot":"","sources":["../../../../../../../../src/local-auth/core/generators/auth-routes/templates/routes/auth_/verify-email.tsx"],"names":[],"mappings":";AAAA,cAAc;AAEd,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EACL,MAAM,EACN,IAAI,EACJ,WAAW,EACX,eAAe,EACf,UAAU,EACV,SAAS,GACV,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAChF,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC/B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,KAAK,GAAG,eAAe,CAAC,qBAAqB,CAAC,CAAC;IAC1D,cAAc,EAAE,CAAC,CAAC,MAAM,CAAC;QACvB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;KAC7B,CAAC;IACF,SAAS,EAAE,eAAe;IAC1B,UAAU,EAAE,CAAC,EAAE,MAA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