@baseplate-dev/plugin-auth 3.0.4 → 4.0.0

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 (281) hide show
  1. package/dist/auth0/generators/fastify/auth0-module/auth0-module.generator.d.ts +39 -25
  2. package/dist/auth0/generators/fastify/auth0-module/auth0-module.generator.d.ts.map +1 -1
  3. package/dist/auth0/generators/fastify/auth0-module/auth0-module.generator.js +18 -24
  4. package/dist/auth0/generators/fastify/auth0-module/auth0-module.generator.js.map +1 -1
  5. package/dist/auth0/generators/fastify/auth0-module/generated/index.d.ts +16 -0
  6. package/dist/auth0/generators/fastify/auth0-module/generated/index.d.ts.map +1 -1
  7. package/dist/auth0/generators/fastify/auth0-module/generated/template-paths.d.ts +1 -0
  8. package/dist/auth0/generators/fastify/auth0-module/generated/template-paths.d.ts.map +1 -1
  9. package/dist/auth0/generators/fastify/auth0-module/generated/template-paths.js +1 -0
  10. package/dist/auth0/generators/fastify/auth0-module/generated/template-paths.js.map +1 -1
  11. package/dist/auth0/generators/fastify/auth0-module/generated/template-renderers.d.ts +9 -0
  12. package/dist/auth0/generators/fastify/auth0-module/generated/template-renderers.d.ts.map +1 -1
  13. package/dist/auth0/generators/fastify/auth0-module/generated/template-renderers.js +15 -2
  14. package/dist/auth0/generators/fastify/auth0-module/generated/template-renderers.js.map +1 -1
  15. package/dist/auth0/generators/fastify/auth0-module/generated/typed-templates.d.ts +10 -0
  16. package/dist/auth0/generators/fastify/auth0-module/generated/typed-templates.d.ts.map +1 -1
  17. package/dist/auth0/generators/fastify/auth0-module/generated/typed-templates.js +18 -2
  18. package/dist/auth0/generators/fastify/auth0-module/generated/typed-templates.js.map +1 -1
  19. package/dist/auth0/generators/fastify/auth0-module/templates/module/schema/user-session.queries.ts +22 -0
  20. package/dist/auth0/generators/react/auth0-hooks/auth0-hooks.generator.d.ts +0 -5
  21. package/dist/auth0/generators/react/auth0-hooks/auth0-hooks.generator.d.ts.map +1 -1
  22. package/dist/auth0/generators/react/auth0-hooks/auth0-hooks.generator.js +1 -10
  23. package/dist/auth0/generators/react/auth0-hooks/auth0-hooks.generator.js.map +1 -1
  24. package/dist/auth0/generators/react/auth0-hooks/generated/index.d.ts +0 -18
  25. package/dist/auth0/generators/react/auth0-hooks/generated/index.d.ts.map +1 -1
  26. package/dist/auth0/generators/react/auth0-hooks/generated/template-paths.d.ts +0 -2
  27. package/dist/auth0/generators/react/auth0-hooks/generated/template-paths.d.ts.map +1 -1
  28. package/dist/auth0/generators/react/auth0-hooks/generated/template-paths.js +0 -2
  29. package/dist/auth0/generators/react/auth0-hooks/generated/template-paths.js.map +1 -1
  30. package/dist/auth0/generators/react/auth0-hooks/generated/template-renderers.d.ts +1 -7
  31. package/dist/auth0/generators/react/auth0-hooks/generated/template-renderers.d.ts.map +1 -1
  32. package/dist/auth0/generators/react/auth0-hooks/generated/template-renderers.js +3 -12
  33. package/dist/auth0/generators/react/auth0-hooks/generated/template-renderers.js.map +1 -1
  34. package/dist/auth0/generators/react/auth0-hooks/generated/ts-import-providers.d.ts +0 -1
  35. package/dist/auth0/generators/react/auth0-hooks/generated/ts-import-providers.d.ts.map +1 -1
  36. package/dist/auth0/generators/react/auth0-hooks/generated/ts-import-providers.js +0 -1
  37. package/dist/auth0/generators/react/auth0-hooks/generated/ts-import-providers.js.map +1 -1
  38. package/dist/auth0/generators/react/auth0-hooks/generated/typed-templates.d.ts +0 -23
  39. package/dist/auth0/generators/react/auth0-hooks/generated/typed-templates.d.ts.map +1 -1
  40. package/dist/auth0/generators/react/auth0-hooks/generated/typed-templates.js +4 -33
  41. package/dist/auth0/generators/react/auth0-hooks/generated/typed-templates.js.map +1 -1
  42. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/admin-crud-manage-roles-action.generator.d.ts +25 -4
  43. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/admin-crud-manage-roles-action.generator.d.ts.map +1 -1
  44. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/admin-crud-manage-roles-action.generator.js +16 -13
  45. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/admin-crud-manage-roles-action.generator.js.map +1 -1
  46. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/index.d.ts +24 -7
  47. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/index.d.ts.map +1 -1
  48. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/template-paths.d.ts +0 -1
  49. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/template-paths.d.ts.map +1 -1
  50. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/template-paths.js +0 -1
  51. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/template-paths.js.map +1 -1
  52. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/template-renderers.d.ts +13 -6
  53. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/template-renderers.d.ts.map +1 -1
  54. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/template-renderers.js +5 -12
  55. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/template-renderers.js.map +1 -1
  56. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/typed-templates.d.ts +12 -5
  57. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/typed-templates.d.ts.map +1 -1
  58. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/typed-templates.js +3 -12
  59. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/typed-templates.js.map +1 -1
  60. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/templates/routes/-components/role-manager-dialog.d.ts +3 -2
  61. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/templates/routes/-components/role-manager-dialog.d.ts.map +1 -1
  62. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/templates/routes/-components/role-manager-dialog.js +26 -7
  63. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/templates/routes/-components/role-manager-dialog.js.map +1 -1
  64. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/templates/routes/-components/role-manager-dialog.tsx +34 -12
  65. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/admin-crud-reset-password-action.generator.d.ts +25 -4
  66. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/admin-crud-reset-password-action.generator.d.ts.map +1 -1
  67. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/admin-crud-reset-password-action.generator.js +35 -25
  68. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/admin-crud-reset-password-action.generator.js.map +1 -1
  69. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/index.d.ts +24 -7
  70. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/index.d.ts.map +1 -1
  71. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/template-paths.d.ts +0 -1
  72. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/template-paths.d.ts.map +1 -1
  73. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/template-paths.js +0 -1
  74. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/template-paths.js.map +1 -1
  75. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/template-renderers.d.ts +13 -6
  76. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/template-renderers.d.ts.map +1 -1
  77. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/template-renderers.js +5 -12
  78. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/template-renderers.js.map +1 -1
  79. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/typed-templates.d.ts +24 -7
  80. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/typed-templates.d.ts.map +1 -1
  81. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/typed-templates.js +3 -12
  82. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/typed-templates.js.map +1 -1
  83. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/templates/routes/-components/password-reset-dialog.d.ts +3 -2
  84. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/templates/routes/-components/password-reset-dialog.d.ts.map +1 -1
  85. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/templates/routes/-components/password-reset-dialog.js +22 -6
  86. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/templates/routes/-components/password-reset-dialog.js.map +1 -1
  87. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/templates/routes/-components/password-reset-dialog.tsx +30 -11
  88. package/dist/local-auth/admin/generators/admin-crud-roles-column/admin-crud-roles-column.generator.d.ts.map +1 -1
  89. package/dist/local-auth/admin/generators/admin-crud-roles-column/admin-crud-roles-column.generator.js +7 -11
  90. package/dist/local-auth/admin/generators/admin-crud-roles-column/admin-crud-roles-column.generator.js.map +1 -1
  91. package/dist/local-auth/admin/node.d.ts.map +1 -1
  92. package/dist/local-auth/admin/node.js +2 -6
  93. package/dist/local-auth/admin/node.js.map +1 -1
  94. package/dist/local-auth/core/generators/auth-hooks/auth-hooks.generator.d.ts +12 -3
  95. package/dist/local-auth/core/generators/auth-hooks/auth-hooks.generator.d.ts.map +1 -1
  96. package/dist/local-auth/core/generators/auth-hooks/auth-hooks.generator.js +0 -1
  97. package/dist/local-auth/core/generators/auth-hooks/auth-hooks.generator.js.map +1 -1
  98. package/dist/local-auth/core/generators/auth-hooks/generated/index.d.ts +36 -18
  99. package/dist/local-auth/core/generators/auth-hooks/generated/index.d.ts.map +1 -1
  100. package/dist/local-auth/core/generators/auth-hooks/generated/template-paths.d.ts +0 -3
  101. package/dist/local-auth/core/generators/auth-hooks/generated/template-paths.d.ts.map +1 -1
  102. package/dist/local-auth/core/generators/auth-hooks/generated/template-paths.js +0 -3
  103. package/dist/local-auth/core/generators/auth-hooks/generated/template-paths.js.map +1 -1
  104. package/dist/local-auth/core/generators/auth-hooks/generated/template-renderers.d.ts +13 -6
  105. package/dist/local-auth/core/generators/auth-hooks/generated/template-renderers.d.ts.map +1 -1
  106. package/dist/local-auth/core/generators/auth-hooks/generated/template-renderers.js +5 -12
  107. package/dist/local-auth/core/generators/auth-hooks/generated/template-renderers.js.map +1 -1
  108. package/dist/local-auth/core/generators/auth-hooks/generated/ts-import-providers.d.ts +0 -1
  109. package/dist/local-auth/core/generators/auth-hooks/generated/ts-import-providers.d.ts.map +1 -1
  110. package/dist/local-auth/core/generators/auth-hooks/generated/ts-import-providers.js +0 -1
  111. package/dist/local-auth/core/generators/auth-hooks/generated/ts-import-providers.js.map +1 -1
  112. package/dist/local-auth/core/generators/auth-hooks/generated/typed-templates.d.ts +48 -30
  113. package/dist/local-auth/core/generators/auth-hooks/generated/typed-templates.d.ts.map +1 -1
  114. package/dist/local-auth/core/generators/auth-hooks/generated/typed-templates.js +6 -49
  115. package/dist/local-auth/core/generators/auth-hooks/generated/typed-templates.js.map +1 -1
  116. package/dist/local-auth/core/generators/auth-hooks/templates/src/hooks/use-log-out.d.ts +1 -0
  117. package/dist/local-auth/core/generators/auth-hooks/templates/src/hooks/use-log-out.d.ts.map +1 -1
  118. package/dist/local-auth/core/generators/auth-hooks/templates/src/hooks/use-log-out.js +9 -2
  119. package/dist/local-auth/core/generators/auth-hooks/templates/src/hooks/use-log-out.js.map +1 -1
  120. package/dist/local-auth/core/generators/auth-hooks/templates/src/hooks/use-log-out.ts +10 -2
  121. package/dist/local-auth/core/generators/auth-hooks/templates/src/hooks/use-session.d.ts +2 -2
  122. package/dist/local-auth/core/generators/auth-hooks/templates/src/hooks/use-session.d.ts.map +1 -1
  123. package/dist/local-auth/core/generators/auth-hooks/templates/src/hooks/use-session.js +0 -1
  124. package/dist/local-auth/core/generators/auth-hooks/templates/src/hooks/use-session.js.map +1 -1
  125. package/dist/local-auth/core/generators/auth-hooks/templates/src/hooks/use-session.ts +2 -2
  126. package/dist/local-auth/core/generators/auth-module/auth-module.generator.d.ts.map +1 -1
  127. package/dist/local-auth/core/generators/auth-module/auth-module.generator.js +3 -0
  128. package/dist/local-auth/core/generators/auth-module/auth-module.generator.js.map +1 -1
  129. package/dist/local-auth/core/generators/auth-module/generated/index.d.ts +6 -1
  130. package/dist/local-auth/core/generators/auth-module/generated/index.d.ts.map +1 -1
  131. package/dist/local-auth/core/generators/auth-module/generated/typed-templates.d.ts +12 -2
  132. package/dist/local-auth/core/generators/auth-module/generated/typed-templates.d.ts.map +1 -1
  133. package/dist/local-auth/core/generators/auth-module/generated/typed-templates.js +5 -2
  134. package/dist/local-auth/core/generators/auth-module/generated/typed-templates.js.map +1 -1
  135. package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-session.queries.js +16 -0
  136. package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-session.queries.js.map +1 -1
  137. package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-session.queries.ts +19 -0
  138. package/dist/local-auth/core/generators/auth-routes/auth-routes.generator.d.ts +12 -3
  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 -8
  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 +36 -7
  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/template-paths.d.ts +0 -1
  145. package/dist/local-auth/core/generators/auth-routes/generated/template-paths.d.ts.map +1 -1
  146. package/dist/local-auth/core/generators/auth-routes/generated/template-paths.js +0 -1
  147. package/dist/local-auth/core/generators/auth-routes/generated/template-paths.js.map +1 -1
  148. package/dist/local-auth/core/generators/auth-routes/generated/template-renderers.d.ts +13 -6
  149. package/dist/local-auth/core/generators/auth-routes/generated/template-renderers.d.ts.map +1 -1
  150. package/dist/local-auth/core/generators/auth-routes/generated/template-renderers.js +5 -12
  151. package/dist/local-auth/core/generators/auth-routes/generated/template-renderers.js.map +1 -1
  152. package/dist/local-auth/core/generators/auth-routes/generated/typed-templates.d.ts +48 -9
  153. package/dist/local-auth/core/generators/auth-routes/generated/typed-templates.d.ts.map +1 -1
  154. package/dist/local-auth/core/generators/auth-routes/generated/typed-templates.js +5 -13
  155. package/dist/local-auth/core/generators/auth-routes/generated/typed-templates.js.map +1 -1
  156. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/login.js +11 -2
  157. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/login.js.map +1 -1
  158. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/login.tsx +12 -2
  159. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/register.js +11 -2
  160. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/register.js.map +1 -1
  161. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/register.tsx +12 -2
  162. package/dist/local-auth/core/generators/react-session/generated/index.d.ts +24 -7
  163. package/dist/local-auth/core/generators/react-session/generated/index.d.ts.map +1 -1
  164. package/dist/local-auth/core/generators/react-session/generated/template-paths.d.ts +0 -1
  165. package/dist/local-auth/core/generators/react-session/generated/template-paths.d.ts.map +1 -1
  166. package/dist/local-auth/core/generators/react-session/generated/template-paths.js +0 -1
  167. package/dist/local-auth/core/generators/react-session/generated/template-paths.js.map +1 -1
  168. package/dist/local-auth/core/generators/react-session/generated/template-renderers.d.ts +13 -7
  169. package/dist/local-auth/core/generators/react-session/generated/template-renderers.d.ts.map +1 -1
  170. package/dist/local-auth/core/generators/react-session/generated/template-renderers.js +5 -12
  171. package/dist/local-auth/core/generators/react-session/generated/template-renderers.js.map +1 -1
  172. package/dist/local-auth/core/generators/react-session/generated/typed-templates.d.ts +24 -7
  173. package/dist/local-auth/core/generators/react-session/generated/typed-templates.d.ts.map +1 -1
  174. package/dist/local-auth/core/generators/react-session/generated/typed-templates.js +4 -15
  175. package/dist/local-auth/core/generators/react-session/generated/typed-templates.js.map +1 -1
  176. package/dist/local-auth/core/generators/react-session/react-session.generator.d.ts +12 -3
  177. package/dist/local-auth/core/generators/react-session/react-session.generator.d.ts.map +1 -1
  178. package/dist/local-auth/core/generators/react-session/react-session.generator.js +0 -1
  179. package/dist/local-auth/core/generators/react-session/react-session.generator.js.map +1 -1
  180. package/dist/local-auth/core/generators/react-session/templates/src/app/user-session-provider.d.ts.map +1 -1
  181. package/dist/local-auth/core/generators/react-session/templates/src/app/user-session-provider.js +10 -2
  182. package/dist/local-auth/core/generators/react-session/templates/src/app/user-session-provider.js.map +1 -1
  183. package/dist/local-auth/core/generators/react-session/templates/src/app/user-session-provider.tsx +11 -2
  184. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/index.d.ts +0 -12
  185. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/index.d.ts.map +1 -1
  186. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/template-paths.d.ts +0 -2
  187. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/template-paths.d.ts.map +1 -1
  188. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/template-paths.js +0 -2
  189. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/template-paths.js.map +1 -1
  190. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/template-renderers.d.ts +1 -7
  191. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/template-renderers.d.ts.map +1 -1
  192. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/template-renderers.js +2 -14
  193. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/template-renderers.js.map +1 -1
  194. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/ts-import-providers.d.ts +0 -1
  195. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/ts-import-providers.d.ts.map +1 -1
  196. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/ts-import-providers.js +0 -1
  197. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/ts-import-providers.js.map +1 -1
  198. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/typed-templates.d.ts +0 -15
  199. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/typed-templates.d.ts.map +1 -1
  200. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/typed-templates.js +2 -31
  201. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/typed-templates.js.map +1 -1
  202. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/placeholder-auth-hooks.generator.d.ts +0 -5
  203. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/placeholder-auth-hooks.generator.d.ts.map +1 -1
  204. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/placeholder-auth-hooks.generator.js +1 -7
  205. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/placeholder-auth-hooks.generator.js.map +1 -1
  206. package/dist/web/assets/{__federation_expose_auth0CoreCommon-DxPG_Wc0.js → __federation_expose_auth0CoreCommon-Ga9LD3d6.js} +3 -3
  207. package/dist/web/assets/{__federation_expose_auth0CoreCommon-DxPG_Wc0.js.map → __federation_expose_auth0CoreCommon-Ga9LD3d6.js.map} +1 -1
  208. package/dist/web/assets/{__federation_expose_auth0CoreWeb-B9jV1EyN.js → __federation_expose_auth0CoreWeb-CZueDXPK.js} +5 -5
  209. package/dist/web/assets/{__federation_expose_auth0CoreWeb-B9jV1EyN.js.map → __federation_expose_auth0CoreWeb-CZueDXPK.js.map} +1 -1
  210. package/dist/web/assets/{__federation_expose_authCoreCommon-Cxa_7fkO.js → __federation_expose_authCoreCommon-BrTLsuJC.js} +3 -3
  211. package/dist/web/assets/{__federation_expose_authCoreCommon-Cxa_7fkO.js.map → __federation_expose_authCoreCommon-BrTLsuJC.js.map} +1 -1
  212. package/dist/web/assets/{__federation_expose_authCoreWeb-CTQI1rXb.js → __federation_expose_authCoreWeb-C8rgnA2v.js} +6 -6
  213. package/dist/web/assets/{__federation_expose_authCoreWeb-CTQI1rXb.js.map → __federation_expose_authCoreWeb-C8rgnA2v.js.map} +1 -1
  214. package/dist/web/assets/{__federation_expose_local-authAdminCommon-C0_ovnDb.js → __federation_expose_local-authAdminCommon-C75-DAzO.js} +2 -2
  215. package/dist/web/assets/{__federation_expose_local-authAdminCommon-C0_ovnDb.js.map → __federation_expose_local-authAdminCommon-C75-DAzO.js.map} +1 -1
  216. package/dist/web/assets/{__federation_expose_local-authAdminWeb-GqHU6av7.js → __federation_expose_local-authAdminWeb-D2xGvwyL.js} +2 -2
  217. package/dist/web/assets/{__federation_expose_local-authAdminWeb-GqHU6av7.js.map → __federation_expose_local-authAdminWeb-D2xGvwyL.js.map} +1 -1
  218. package/dist/web/assets/{__federation_expose_local-authCoreCommon-PHXPCKoj.js → __federation_expose_local-authCoreCommon-BFUbyPYg.js} +3 -3
  219. package/dist/web/assets/{__federation_expose_local-authCoreCommon-PHXPCKoj.js.map → __federation_expose_local-authCoreCommon-BFUbyPYg.js.map} +1 -1
  220. package/dist/web/assets/{__federation_expose_local-authCoreWeb-Dz4oU0uP.js → __federation_expose_local-authCoreWeb-ChyvdsRq.js} +5 -5
  221. package/dist/web/assets/{__federation_expose_local-authCoreWeb-Dz4oU0uP.js.map → __federation_expose_local-authCoreWeb-ChyvdsRq.js.map} +1 -1
  222. package/dist/web/assets/{__federation_expose_placeholder-authCoreCommon-CrB_sJO_.js → __federation_expose_placeholder-authCoreCommon-DrFV9FSW.js} +3 -3
  223. package/dist/web/assets/{__federation_expose_placeholder-authCoreCommon-CrB_sJO_.js.map → __federation_expose_placeholder-authCoreCommon-DrFV9FSW.js.map} +1 -1
  224. package/dist/web/assets/{__federation_expose_placeholder-authCoreWeb-KJ8YuuIQ.js → __federation_expose_placeholder-authCoreWeb-CT8JKYLB.js} +5 -5
  225. package/dist/web/assets/{__federation_expose_placeholder-authCoreWeb-KJ8YuuIQ.js.map → __federation_expose_placeholder-authCoreWeb-CT8JKYLB.js.map} +1 -1
  226. package/dist/web/assets/{__federation_fn_import-CVjKjdRb.js → __federation_fn_import-C_QCk5FX.js} +2 -2
  227. package/dist/web/assets/{__federation_fn_import-CVjKjdRb.js.map → __federation_fn_import-C_QCk5FX.js.map} +1 -1
  228. package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib/{web-BTmJxb08.js → web-DtztAtUw.js} +5 -5
  229. package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib/{web-BTmJxb08.js.map → web-DtztAtUw.js.map} +1 -1
  230. package/dist/web/assets/__federation_shared_@baseplate-dev/{project-builder-lib-FK4Jv94w.js → project-builder-lib-CcNtL_U6.js} +293 -216
  231. package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib-CcNtL_U6.js.map +1 -0
  232. package/dist/web/assets/__federation_shared_@baseplate-dev/{ui-components-jZLf5m_y.js → ui-components-DA_4I2Vy.js} +5 -5
  233. package/dist/web/assets/__federation_shared_@baseplate-dev/{ui-components-jZLf5m_y.js.map → ui-components-DA_4I2Vy.js.map} +1 -1
  234. package/dist/web/assets/__federation_shared_@baseplate-dev/{utils-CAgM5SRt.js → utils-Bxy-1ETU.js} +34 -3
  235. package/dist/web/assets/__federation_shared_@baseplate-dev/utils-Bxy-1ETU.js.map +1 -0
  236. package/dist/web/assets/__federation_shared_@tanstack/{react-router-DynsSbJG.js → react-router-DooFj-IS.js} +2 -2
  237. package/dist/web/assets/__federation_shared_@tanstack/{react-router-DynsSbJG.js.map → react-router-DooFj-IS.js.map} +1 -1
  238. package/dist/web/assets/{get-auth-plugin-definition-DqZ2Eg7c.js → get-auth-plugin-definition-D2XMaoy7.js} +2 -2
  239. package/dist/web/assets/{get-auth-plugin-definition-DqZ2Eg7c.js.map → get-auth-plugin-definition-D2XMaoy7.js.map} +1 -1
  240. package/dist/web/assets/{index-Dccn3WBN.js → index-DwJT6_Wn.js} +2 -2
  241. package/dist/web/assets/{index-Dccn3WBN.js.map → index-DwJT6_Wn.js.map} +1 -1
  242. package/dist/web/assets/{index.esm-DeCjXqFv.js → index.esm-ChwWPPiL.js} +2 -2
  243. package/dist/web/assets/{index.esm-DeCjXqFv.js.map → index.esm-ChwWPPiL.js.map} +1 -1
  244. package/dist/web/assets/{model-merger-kOQ_dmiE.js → model-merger-gGkFnyaY.js} +7 -2
  245. package/dist/web/assets/model-merger-gGkFnyaY.js.map +1 -0
  246. package/dist/web/assets/{plugin-definition-qkkt1X28.js → plugin-definition-QRBMcFiG.js} +2 -2
  247. package/dist/web/assets/{plugin-definition-qkkt1X28.js.map → plugin-definition-QRBMcFiG.js.map} +1 -1
  248. package/dist/web/assets/{plugin-definition-CxKhFkmJ.js → plugin-definition-_slrOM0G.js} +2 -2
  249. package/dist/web/assets/{plugin-definition-CxKhFkmJ.js.map → plugin-definition-_slrOM0G.js.map} +1 -1
  250. package/dist/web/assets/{plugin-definition-JFxKP18O.js → plugin-definition-hAzbWO7b.js} +2 -2
  251. package/dist/web/assets/{plugin-definition-JFxKP18O.js.map → plugin-definition-hAzbWO7b.js.map} +1 -1
  252. package/dist/web/assets/{plugin-definition-DKygiFuR.js → plugin-definition-rpMj4pr8.js} +2 -2
  253. package/dist/web/assets/{plugin-definition-DKygiFuR.js.map → plugin-definition-rpMj4pr8.js.map} +1 -1
  254. package/dist/web/assets/{react-DA5A88WZ.js → react-DbX1FP85.js} +2 -2
  255. package/dist/web/assets/{react-DA5A88WZ.js.map → react-DbX1FP85.js.map} +1 -1
  256. package/dist/web/assets/remoteEntry.js +10 -10
  257. package/dist/web/assets/{styles-CfTjrsB-.js → styles-DqLt1Blm.js} +3 -3
  258. package/dist/web/assets/{styles-CfTjrsB-.js.map → styles-DqLt1Blm.js.map} +1 -1
  259. package/package.json +12 -12
  260. package/dist/auth0/generators/react/auth0-hooks/templates/src/hooks/use-current-user.gql +0 -10
  261. package/dist/auth0/generators/react/auth0-hooks/templates/src/hooks/use-current-user.ts +0 -30
  262. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/templates/routes/-components/role-manager-dialog.gql +0 -7
  263. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/templates/routes/-components/password-reset-dialog.gql +0 -7
  264. package/dist/local-auth/core/generators/auth-hooks/templates/src/hooks/use-current-user.d.ts +0 -18
  265. package/dist/local-auth/core/generators/auth-hooks/templates/src/hooks/use-current-user.d.ts.map +0 -1
  266. package/dist/local-auth/core/generators/auth-hooks/templates/src/hooks/use-current-user.gql +0 -10
  267. package/dist/local-auth/core/generators/auth-hooks/templates/src/hooks/use-current-user.js +0 -22
  268. package/dist/local-auth/core/generators/auth-hooks/templates/src/hooks/use-current-user.js.map +0 -1
  269. package/dist/local-auth/core/generators/auth-hooks/templates/src/hooks/use-current-user.ts +0 -39
  270. package/dist/local-auth/core/generators/auth-hooks/templates/src/hooks/use-log-out.gql +0 -5
  271. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/queries.gql +0 -17
  272. package/dist/local-auth/core/generators/react-session/templates/src/app/user-session-provider.gql +0 -7
  273. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/templates/src/hooks/use-current-user.d.ts +0 -14
  274. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/templates/src/hooks/use-current-user.d.ts.map +0 -1
  275. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/templates/src/hooks/use-current-user.gql +0 -10
  276. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/templates/src/hooks/use-current-user.js +0 -23
  277. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/templates/src/hooks/use-current-user.js.map +0 -1
  278. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/templates/src/hooks/use-current-user.ts +0 -35
  279. package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib-FK4Jv94w.js.map +0 -1
  280. package/dist/web/assets/__federation_shared_@baseplate-dev/utils-CAgM5SRt.js.map +0 -1
  281. package/dist/web/assets/model-merger-kOQ_dmiE.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@baseplate-dev/plugin-auth",
3
- "version": "3.0.4",
3
+ "version": "4.0.0",
4
4
  "description": "Contains the auth plugin for Baseplate",
5
5
  "keywords": [
6
6
  "authentication",
@@ -36,11 +36,11 @@
36
36
  "react-hook-form": "7.60.0",
37
37
  "react-icons": "5.5.0",
38
38
  "zod": "^4.1.13",
39
- "@baseplate-dev/fastify-generators": "0.4.4",
40
- "@baseplate-dev/react-generators": "0.4.4",
41
- "@baseplate-dev/ui-components": "0.4.4",
42
- "@baseplate-dev/utils": "0.4.4",
43
- "@baseplate-dev/core-generators": "0.4.4"
39
+ "@baseplate-dev/core-generators": "0.5.0",
40
+ "@baseplate-dev/fastify-generators": "0.5.0",
41
+ "@baseplate-dev/react-generators": "0.5.0",
42
+ "@baseplate-dev/ui-components": "0.5.0",
43
+ "@baseplate-dev/utils": "0.5.0"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@originjs/vite-plugin-federation": "1.3.6",
@@ -56,14 +56,14 @@
56
56
  "tailwindcss": "4.1.13",
57
57
  "typescript": "5.8.3",
58
58
  "vite": "7.1.12",
59
- "vitest": "3.2.4",
60
- "@baseplate-dev/project-builder-lib": "0.4.4",
61
- "@baseplate-dev/sync": "0.4.4",
62
- "@baseplate-dev/tools": "0.4.4"
59
+ "vitest": "4.0.16",
60
+ "@baseplate-dev/project-builder-lib": "0.5.0",
61
+ "@baseplate-dev/sync": "0.5.0",
62
+ "@baseplate-dev/tools": "0.5.0"
63
63
  },
64
64
  "peerDependencies": {
65
- "@baseplate-dev/project-builder-lib": "0.4.4",
66
- "@baseplate-dev/sync": "0.4.4"
65
+ "@baseplate-dev/project-builder-lib": "0.5.0",
66
+ "@baseplate-dev/sync": "0.5.0"
67
67
  },
68
68
  "engines": {
69
69
  "node": "^22.0.0"
@@ -1,10 +0,0 @@
1
- fragment CurrentUser on User {
2
- id
3
- email
4
- }
5
-
6
- query getUserById($id: Uuid!) {
7
- TPL_USER_QUERY_NAME(id: $id) {
8
- ...CurrentUser
9
- }
10
- }
@@ -1,30 +0,0 @@
1
- // @ts-nocheck
2
-
3
- import type { CurrentUserFragment } from '%generatedGraphqlImports';
4
-
5
- import { useQuery } from '@apollo/client/react';
6
-
7
- import { GetUserByIdDocument } from '%generatedGraphqlImports';
8
- import { useSession } from '$useSession';
9
-
10
- interface UseCurrentUserResult {
11
- user?: CurrentUserFragment;
12
- loading: boolean;
13
- error?: Error | null;
14
- }
15
-
16
- export function useCurrentUser(): UseCurrentUserResult {
17
- const { userId } = useSession();
18
- const { data, loading, error } = useQuery(GetUserByIdDocument, {
19
- variables: { id: userId ?? '' },
20
- skip: !userId,
21
- });
22
-
23
- const noUserError = !userId ? new Error('No user logged in') : null;
24
-
25
- return {
26
- user: data?.TPL_USER,
27
- loading,
28
- error: error ?? noUserError,
29
- };
30
- }
@@ -1,7 +0,0 @@
1
- mutation UpdateUserRoles($input: UpdateUserRolesInput!) {
2
- updateUserRoles(input: $input) {
3
- user {
4
- ...TPL_USER_ROW_FRAGMENT
5
- }
6
- }
7
- }
@@ -1,7 +0,0 @@
1
- mutation ResetUserPassword($input: ResetUserPasswordInput!) {
2
- resetUserPassword(input: $input) {
3
- user {
4
- ...TPL_USER_ROW_FRAGMENT
5
- }
6
- }
7
- }
@@ -1,18 +0,0 @@
1
- import type { CurrentUserFragment } from '%generatedGraphqlImports';
2
- /**
3
- * Result returned by useCurrentUser hook
4
- */
5
- export interface UseCurrentUserResult {
6
- /** Current user data from GraphQL */
7
- user?: CurrentUserFragment;
8
- /** Whether user data is loading */
9
- loading: boolean;
10
- /** Any error that occurred while fetching user data */
11
- error?: Error | undefined;
12
- }
13
- /**
14
- * Fetches information about the current user via GraphQL
15
- * @returns A result containing the current user or an error if the user is not authenticated
16
- */
17
- export declare function useCurrentUser(): UseCurrentUserResult;
18
- //# sourceMappingURL=use-current-user.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-current-user.d.ts","sourceRoot":"","sources":["../../../../../../../../src/local-auth/core/generators/auth-hooks/templates/src/hooks/use-current-user.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAMpE;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,qCAAqC;IACrC,IAAI,CAAC,EAAE,mBAAmB,CAAC;IAC3B,mCAAmC;IACnC,OAAO,EAAE,OAAO,CAAC;IACjB,uDAAuD;IACvD,KAAK,CAAC,EAAE,KAAK,GAAG,SAAS,CAAC;CAC3B;AAED;;;GAGG;AACH,wBAAgB,cAAc,IAAI,oBAAoB,CAcrD"}
@@ -1,10 +0,0 @@
1
- fragment CurrentUser on User {
2
- id
3
- email
4
- }
5
-
6
- query getUserById($id: Uuid!) {
7
- user(id: $id) {
8
- ...CurrentUser
9
- }
10
- }
@@ -1,22 +0,0 @@
1
- // @ts-nocheck
2
- import { useSession } from '$useSession';
3
- import { GetUserByIdDocument } from '%generatedGraphqlImports';
4
- import { useQuery } from '@apollo/client/react';
5
- /**
6
- * Fetches information about the current user via GraphQL
7
- * @returns A result containing the current user or an error if the user is not authenticated
8
- */
9
- export function useCurrentUser() {
10
- const { userId } = useSession();
11
- const { data, loading, error } = useQuery(GetUserByIdDocument, {
12
- variables: { id: userId ?? '' },
13
- skip: !userId,
14
- });
15
- const noUserError = !userId ? new Error('No user logged in') : undefined;
16
- return {
17
- user: data?.user,
18
- loading,
19
- error: error ?? noUserError,
20
- };
21
- }
22
- //# sourceMappingURL=use-current-user.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-current-user.js","sourceRoot":"","sources":["../../../../../../../../src/local-auth/core/generators/auth-hooks/templates/src/hooks/use-current-user.ts"],"names":[],"mappings":"AAAA,cAAc;AAId,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAchD;;;GAGG;AACH,MAAM,UAAU,cAAc;IAC5B,MAAM,EAAE,MAAM,EAAE,GAAG,UAAU,EAAE,CAAC;IAChC,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,QAAQ,CAAC,mBAAmB,EAAE;QAC7D,SAAS,EAAE,EAAE,EAAE,EAAE,MAAM,IAAI,EAAE,EAAE;QAC/B,IAAI,EAAE,CAAC,MAAM;KACd,CAAC,CAAC;IAEH,MAAM,WAAW,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAEzE,OAAO;QACL,IAAI,EAAE,IAAI,EAAE,IAAI;QAChB,OAAO;QACP,KAAK,EAAE,KAAK,IAAI,WAAW;KAC5B,CAAC;AACJ,CAAC"}
@@ -1,39 +0,0 @@
1
- // @ts-nocheck
2
-
3
- import type { CurrentUserFragment } from '%generatedGraphqlImports';
4
-
5
- import { useSession } from '$useSession';
6
- import { GetUserByIdDocument } from '%generatedGraphqlImports';
7
- import { useQuery } from '@apollo/client/react';
8
-
9
- /**
10
- * Result returned by useCurrentUser hook
11
- */
12
- export interface UseCurrentUserResult {
13
- /** Current user data from GraphQL */
14
- user?: CurrentUserFragment;
15
- /** Whether user data is loading */
16
- loading: boolean;
17
- /** Any error that occurred while fetching user data */
18
- error?: Error | undefined;
19
- }
20
-
21
- /**
22
- * Fetches information about the current user via GraphQL
23
- * @returns A result containing the current user or an error if the user is not authenticated
24
- */
25
- export function useCurrentUser(): UseCurrentUserResult {
26
- const { userId } = useSession();
27
- const { data, loading, error } = useQuery(GetUserByIdDocument, {
28
- variables: { id: userId ?? '' },
29
- skip: !userId,
30
- });
31
-
32
- const noUserError = !userId ? new Error('No user logged in') : undefined;
33
-
34
- return {
35
- user: data?.user,
36
- loading,
37
- error: error ?? noUserError,
38
- };
39
- }
@@ -1,5 +0,0 @@
1
- mutation logOut {
2
- logOut {
3
- success
4
- }
5
- }
@@ -1,17 +0,0 @@
1
- mutation RegisterWithEmailPassword($input: RegisterWithEmailPasswordInput!) {
2
- registerWithEmailPassword(input: $input) {
3
- session {
4
- userId
5
- roles
6
- }
7
- }
8
- }
9
-
10
- mutation LoginWithEmailPassword($input: LoginWithEmailPasswordInput!) {
11
- loginWithEmailPassword(input: $input) {
12
- session {
13
- userId
14
- roles
15
- }
16
- }
17
- }
@@ -1,7 +0,0 @@
1
- query GetCurrentUserSession {
2
- currentUserSession {
3
- userId
4
- expiresAt
5
- roles
6
- }
7
- }
@@ -1,14 +0,0 @@
1
- import type { CurrentUserFragment } from '%generatedGraphqlImports';
2
- interface UseCurrentUserResult {
3
- user?: CurrentUserFragment;
4
- loading: boolean;
5
- error?: Error | undefined;
6
- }
7
- /**
8
- * Fetches information about the current user
9
- *
10
- * @returns A result containing the current user or an error if the user is not authenticated
11
- */
12
- export declare function useCurrentUser(): UseCurrentUserResult;
13
- export {};
14
- //# sourceMappingURL=use-current-user.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-current-user.d.ts","sourceRoot":"","sources":["../../../../../../../../src/placeholder-auth/core/generators/placeholder-auth-hooks/templates/src/hooks/use-current-user.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAOpE,UAAU,oBAAoB;IAC5B,IAAI,CAAC,EAAE,mBAAmB,CAAC;IAC3B,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,KAAK,GAAG,SAAS,CAAC;CAC3B;AAED;;;;GAIG;AACH,wBAAgB,cAAc,IAAI,oBAAoB,CAcrD"}
@@ -1,10 +0,0 @@
1
- fragment CurrentUser on User {
2
- id
3
- email
4
- }
5
-
6
- query getUserById($id: Uuid!) {
7
- user(id: $id) {
8
- ...CurrentUser
9
- }
10
- }
@@ -1,23 +0,0 @@
1
- // @ts-nocheck
2
- import { useQuery } from '@apollo/client/react';
3
- import { GetUserByIdDocument } from '%generatedGraphqlImports';
4
- import { useSession } from '$useSession';
5
- /**
6
- * Fetches information about the current user
7
- *
8
- * @returns A result containing the current user or an error if the user is not authenticated
9
- */
10
- export function useCurrentUser() {
11
- const { userId } = useSession();
12
- const { data, loading, error } = useQuery(GetUserByIdDocument, {
13
- variables: { id: userId ?? '' },
14
- skip: !userId,
15
- });
16
- const noUserError = !userId ? new Error('No user logged in') : undefined;
17
- return {
18
- user: data?.user,
19
- loading,
20
- error: error ?? noUserError,
21
- };
22
- }
23
- //# sourceMappingURL=use-current-user.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-current-user.js","sourceRoot":"","sources":["../../../../../../../../src/placeholder-auth/core/generators/placeholder-auth-hooks/templates/src/hooks/use-current-user.ts"],"names":[],"mappings":"AAAA,cAAc;AAId,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAQzC;;;;GAIG;AACH,MAAM,UAAU,cAAc;IAC5B,MAAM,EAAE,MAAM,EAAE,GAAG,UAAU,EAAE,CAAC;IAChC,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,QAAQ,CAAC,mBAAmB,EAAE;QAC7D,SAAS,EAAE,EAAE,EAAE,EAAE,MAAM,IAAI,EAAE,EAAE;QAC/B,IAAI,EAAE,CAAC,MAAM;KACd,CAAC,CAAC;IAEH,MAAM,WAAW,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAEzE,OAAO;QACL,IAAI,EAAE,IAAI,EAAE,IAAI;QAChB,OAAO;QACP,KAAK,EAAE,KAAK,IAAI,WAAW;KAC5B,CAAC;AACJ,CAAC"}
@@ -1,35 +0,0 @@
1
- // @ts-nocheck
2
-
3
- import type { CurrentUserFragment } from '%generatedGraphqlImports';
4
-
5
- import { useQuery } from '@apollo/client/react';
6
-
7
- import { GetUserByIdDocument } from '%generatedGraphqlImports';
8
- import { useSession } from '$useSession';
9
-
10
- interface UseCurrentUserResult {
11
- user?: CurrentUserFragment;
12
- loading: boolean;
13
- error?: Error | undefined;
14
- }
15
-
16
- /**
17
- * Fetches information about the current user
18
- *
19
- * @returns A result containing the current user or an error if the user is not authenticated
20
- */
21
- export function useCurrentUser(): UseCurrentUserResult {
22
- const { userId } = useSession();
23
- const { data, loading, error } = useQuery(GetUserByIdDocument, {
24
- variables: { id: userId ?? '' },
25
- skip: !userId,
26
- });
27
-
28
- const noUserError = !userId ? new Error('No user logged in') : undefined;
29
-
30
- return {
31
- user: data?.user,
32
- loading,
33
- error: error ?? noUserError,
34
- };
35
- }