@luochuanyuewu/payload-auth 1.8.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 (424) hide show
  1. package/dist/better-auth/adapter/generate-schema/generate-schema-builder.d.ts +24 -0
  2. package/dist/better-auth/adapter/generate-schema/generate-schema-builder.d.ts.map +1 -0
  3. package/dist/better-auth/adapter/generate-schema/generate-schema-builder.js +317 -0
  4. package/dist/better-auth/adapter/generate-schema/get-payload-schema.d.ts +2 -0
  5. package/dist/better-auth/adapter/generate-schema/get-payload-schema.d.ts.map +1 -0
  6. package/dist/better-auth/adapter/generate-schema/get-payload-schema.js +23 -0
  7. package/dist/better-auth/adapter/generate-schema/index.d.ts +5 -0
  8. package/dist/better-auth/adapter/generate-schema/index.d.ts.map +1 -0
  9. package/dist/better-auth/adapter/generate-schema/index.js +19 -0
  10. package/dist/better-auth/adapter/generate-schema/utils.d.ts +3 -0
  11. package/dist/better-auth/adapter/generate-schema/utils.d.ts.map +1 -0
  12. package/dist/better-auth/adapter/generate-schema/utils.js +20 -0
  13. package/dist/better-auth/adapter/index.d.ts +16 -0
  14. package/dist/better-auth/adapter/index.d.ts.map +1 -0
  15. package/dist/better-auth/adapter/index.js +717 -0
  16. package/dist/better-auth/adapter/transform/index.d.ts +31 -0
  17. package/dist/better-auth/adapter/transform/index.d.ts.map +1 -0
  18. package/dist/better-auth/adapter/transform/index.js +729 -0
  19. package/dist/better-auth/adapter/types.d.ts +11 -0
  20. package/dist/better-auth/adapter/types.d.ts.map +1 -0
  21. package/dist/better-auth/adapter/types.js +3 -0
  22. package/dist/better-auth/generated-types.d.ts +329 -0
  23. package/dist/better-auth/generated-types.d.ts.map +1 -0
  24. package/dist/better-auth/generated-types.js +4 -0
  25. package/dist/better-auth/index.d.ts +4 -0
  26. package/dist/better-auth/index.d.ts.map +1 -0
  27. package/dist/better-auth/index.js +5 -0
  28. package/dist/better-auth/plugin/constants.d.ts +231 -0
  29. package/dist/better-auth/plugin/constants.d.ts.map +1 -0
  30. package/dist/better-auth/plugin/constants.js +259 -0
  31. package/dist/better-auth/plugin/helpers/check-plugin-exists.d.ts +13 -0
  32. package/dist/better-auth/plugin/helpers/check-plugin-exists.d.ts.map +1 -0
  33. package/dist/better-auth/plugin/helpers/check-plugin-exists.js +14 -0
  34. package/dist/better-auth/plugin/helpers/generate-verify-email-url.d.ts +30 -0
  35. package/dist/better-auth/plugin/helpers/generate-verify-email-url.d.ts.map +1 -0
  36. package/dist/better-auth/plugin/helpers/generate-verify-email-url.js +46 -0
  37. package/dist/better-auth/plugin/helpers/get-admin-access.d.ts +8 -0
  38. package/dist/better-auth/plugin/helpers/get-admin-access.d.ts.map +1 -0
  39. package/dist/better-auth/plugin/helpers/get-admin-access.js +22 -0
  40. package/dist/better-auth/plugin/helpers/get-all-roles.d.ts +6 -0
  41. package/dist/better-auth/plugin/helpers/get-all-roles.d.ts.map +1 -0
  42. package/dist/better-auth/plugin/helpers/get-all-roles.js +20 -0
  43. package/dist/better-auth/plugin/helpers/get-better-auth-schema.d.ts +19 -0
  44. package/dist/better-auth/plugin/helpers/get-better-auth-schema.d.ts.map +1 -0
  45. package/dist/better-auth/plugin/helpers/get-better-auth-schema.js +75 -0
  46. package/dist/better-auth/plugin/helpers/get-collection-slug.d.ts +6 -0
  47. package/dist/better-auth/plugin/helpers/get-collection-slug.d.ts.map +1 -0
  48. package/dist/better-auth/plugin/helpers/get-collection-slug.js +20 -0
  49. package/dist/better-auth/plugin/helpers/get-collection.d.ts +28 -0
  50. package/dist/better-auth/plugin/helpers/get-collection.d.ts.map +1 -0
  51. package/dist/better-auth/plugin/helpers/get-collection.js +49 -0
  52. package/dist/better-auth/plugin/helpers/get-ip.d.ts +3 -0
  53. package/dist/better-auth/plugin/helpers/get-ip.d.ts.map +1 -0
  54. package/dist/better-auth/plugin/helpers/get-ip.js +31 -0
  55. package/dist/better-auth/plugin/helpers/get-signed-cookie.d.ts +3 -0
  56. package/dist/better-auth/plugin/helpers/get-signed-cookie.d.ts.map +1 -0
  57. package/dist/better-auth/plugin/helpers/get-signed-cookie.js +63 -0
  58. package/dist/better-auth/plugin/helpers/index.d.ts +2 -0
  59. package/dist/better-auth/plugin/helpers/index.d.ts.map +1 -0
  60. package/dist/better-auth/plugin/helpers/index.js +3 -0
  61. package/dist/better-auth/plugin/helpers/prepare-session-data.d.ts +60 -0
  62. package/dist/better-auth/plugin/helpers/prepare-session-data.d.ts.map +1 -0
  63. package/dist/better-auth/plugin/helpers/prepare-session-data.js +49 -0
  64. package/dist/better-auth/plugin/helpers/sync-resolved-schema-with-collection-map.d.ts +21 -0
  65. package/dist/better-auth/plugin/helpers/sync-resolved-schema-with-collection-map.d.ts.map +1 -0
  66. package/dist/better-auth/plugin/helpers/sync-resolved-schema-with-collection-map.js +63 -0
  67. package/dist/better-auth/plugin/index.d.ts +8 -0
  68. package/dist/better-auth/plugin/index.d.ts.map +1 -0
  69. package/dist/better-auth/plugin/index.js +103 -0
  70. package/dist/better-auth/plugin/lib/apply-disabled-default-auth-config.d.ts +13 -0
  71. package/dist/better-auth/plugin/lib/apply-disabled-default-auth-config.d.ts.map +1 -0
  72. package/dist/better-auth/plugin/lib/apply-disabled-default-auth-config.js +87 -0
  73. package/dist/better-auth/plugin/lib/build-collections/accounts/hooks/sync-password-to-user.d.ts +4 -0
  74. package/dist/better-auth/plugin/lib/build-collections/accounts/hooks/sync-password-to-user.d.ts.map +1 -0
  75. package/dist/better-auth/plugin/lib/build-collections/accounts/hooks/sync-password-to-user.js +51 -0
  76. package/dist/better-auth/plugin/lib/build-collections/accounts/index.d.ts +4 -0
  77. package/dist/better-auth/plugin/lib/build-collections/accounts/index.d.ts.map +1 -0
  78. package/dist/better-auth/plugin/lib/build-collections/accounts/index.js +150 -0
  79. package/dist/better-auth/plugin/lib/build-collections/admin-invitations/hooks/get-url-after-read.d.ts +6 -0
  80. package/dist/better-auth/plugin/lib/build-collections/admin-invitations/hooks/get-url-after-read.d.ts.map +1 -0
  81. package/dist/better-auth/plugin/lib/build-collections/admin-invitations/hooks/get-url-after-read.js +11 -0
  82. package/dist/better-auth/plugin/lib/build-collections/admin-invitations/hooks/get-url-before-change.d.ts +3 -0
  83. package/dist/better-auth/plugin/lib/build-collections/admin-invitations/hooks/get-url-before-change.d.ts.map +1 -0
  84. package/dist/better-auth/plugin/lib/build-collections/admin-invitations/hooks/get-url-before-change.js +8 -0
  85. package/dist/better-auth/plugin/lib/build-collections/admin-invitations/index.d.ts +7 -0
  86. package/dist/better-auth/plugin/lib/build-collections/admin-invitations/index.d.ts.map +1 -0
  87. package/dist/better-auth/plugin/lib/build-collections/admin-invitations/index.js +117 -0
  88. package/dist/better-auth/plugin/lib/build-collections/api-keys.d.ts +4 -0
  89. package/dist/better-auth/plugin/lib/build-collections/api-keys.d.ts.map +1 -0
  90. package/dist/better-auth/plugin/lib/build-collections/api-keys.js +174 -0
  91. package/dist/better-auth/plugin/lib/build-collections/device-code.d.ts +4 -0
  92. package/dist/better-auth/plugin/lib/build-collections/device-code.d.ts.map +1 -0
  93. package/dist/better-auth/plugin/lib/build-collections/device-code.js +49 -0
  94. package/dist/better-auth/plugin/lib/build-collections/index.d.ts +11 -0
  95. package/dist/better-auth/plugin/lib/build-collections/index.d.ts.map +1 -0
  96. package/dist/better-auth/plugin/lib/build-collections/index.js +79 -0
  97. package/dist/better-auth/plugin/lib/build-collections/invitations.d.ts +4 -0
  98. package/dist/better-auth/plugin/lib/build-collections/invitations.d.ts.map +1 -0
  99. package/dist/better-auth/plugin/lib/build-collections/invitations.js +93 -0
  100. package/dist/better-auth/plugin/lib/build-collections/jwks.d.ts +4 -0
  101. package/dist/better-auth/plugin/lib/build-collections/jwks.d.ts.map +1 -0
  102. package/dist/better-auth/plugin/lib/build-collections/jwks.js +58 -0
  103. package/dist/better-auth/plugin/lib/build-collections/members.d.ts +4 -0
  104. package/dist/better-auth/plugin/lib/build-collections/members.d.ts.map +1 -0
  105. package/dist/better-auth/plugin/lib/build-collections/members.js +72 -0
  106. package/dist/better-auth/plugin/lib/build-collections/oauth-access-tokens.d.ts +4 -0
  107. package/dist/better-auth/plugin/lib/build-collections/oauth-access-tokens.d.ts.map +1 -0
  108. package/dist/better-auth/plugin/lib/build-collections/oauth-access-tokens.js +105 -0
  109. package/dist/better-auth/plugin/lib/build-collections/oauth-applications.d.ts +4 -0
  110. package/dist/better-auth/plugin/lib/build-collections/oauth-applications.d.ts.map +1 -0
  111. package/dist/better-auth/plugin/lib/build-collections/oauth-applications.js +117 -0
  112. package/dist/better-auth/plugin/lib/build-collections/oauth-consents.d.ts +4 -0
  113. package/dist/better-auth/plugin/lib/build-collections/oauth-consents.d.ts.map +1 -0
  114. package/dist/better-auth/plugin/lib/build-collections/oauth-consents.js +87 -0
  115. package/dist/better-auth/plugin/lib/build-collections/organization-roles.d.ts +4 -0
  116. package/dist/better-auth/plugin/lib/build-collections/organization-roles.d.ts.map +1 -0
  117. package/dist/better-auth/plugin/lib/build-collections/organization-roles.js +65 -0
  118. package/dist/better-auth/plugin/lib/build-collections/organizations.d.ts +4 -0
  119. package/dist/better-auth/plugin/lib/build-collections/organizations.d.ts.map +1 -0
  120. package/dist/better-auth/plugin/lib/build-collections/organizations.js +106 -0
  121. package/dist/better-auth/plugin/lib/build-collections/passkeys.d.ts +4 -0
  122. package/dist/better-auth/plugin/lib/build-collections/passkeys.d.ts.map +1 -0
  123. package/dist/better-auth/plugin/lib/build-collections/passkeys.js +115 -0
  124. package/dist/better-auth/plugin/lib/build-collections/rate-limit.d.ts +4 -0
  125. package/dist/better-auth/plugin/lib/build-collections/rate-limit.d.ts.map +1 -0
  126. package/dist/better-auth/plugin/lib/build-collections/rate-limit.js +54 -0
  127. package/dist/better-auth/plugin/lib/build-collections/scim-provider.d.ts +4 -0
  128. package/dist/better-auth/plugin/lib/build-collections/scim-provider.d.ts.map +1 -0
  129. package/dist/better-auth/plugin/lib/build-collections/scim-provider.js +65 -0
  130. package/dist/better-auth/plugin/lib/build-collections/sessions.d.ts +4 -0
  131. package/dist/better-auth/plugin/lib/build-collections/sessions.d.ts.map +1 -0
  132. package/dist/better-auth/plugin/lib/build-collections/sessions.js +140 -0
  133. package/dist/better-auth/plugin/lib/build-collections/sso-providers.d.ts +4 -0
  134. package/dist/better-auth/plugin/lib/build-collections/sso-providers.d.ts.map +1 -0
  135. package/dist/better-auth/plugin/lib/build-collections/sso-providers.js +80 -0
  136. package/dist/better-auth/plugin/lib/build-collections/subscriptions.d.ts +4 -0
  137. package/dist/better-auth/plugin/lib/build-collections/subscriptions.d.ts.map +1 -0
  138. package/dist/better-auth/plugin/lib/build-collections/subscriptions.js +110 -0
  139. package/dist/better-auth/plugin/lib/build-collections/team-members.d.ts +4 -0
  140. package/dist/better-auth/plugin/lib/build-collections/team-members.d.ts.map +1 -0
  141. package/dist/better-auth/plugin/lib/build-collections/team-members.js +63 -0
  142. package/dist/better-auth/plugin/lib/build-collections/teams.d.ts +4 -0
  143. package/dist/better-auth/plugin/lib/build-collections/teams.d.ts.map +1 -0
  144. package/dist/better-auth/plugin/lib/build-collections/teams.js +74 -0
  145. package/dist/better-auth/plugin/lib/build-collections/two-factors.d.ts +4 -0
  146. package/dist/better-auth/plugin/lib/build-collections/two-factors.d.ts.map +1 -0
  147. package/dist/better-auth/plugin/lib/build-collections/two-factors.js +66 -0
  148. package/dist/better-auth/plugin/lib/build-collections/users/better-auth-strategy.d.ts +8 -0
  149. package/dist/better-auth/plugin/lib/build-collections/users/better-auth-strategy.d.ts.map +1 -0
  150. package/dist/better-auth/plugin/lib/build-collections/users/better-auth-strategy.js +52 -0
  151. package/dist/better-auth/plugin/lib/build-collections/users/endpoints/generate-invite-url.d.ts +12 -0
  152. package/dist/better-auth/plugin/lib/build-collections/users/endpoints/generate-invite-url.d.ts.map +1 -0
  153. package/dist/better-auth/plugin/lib/build-collections/users/endpoints/generate-invite-url.js +68 -0
  154. package/dist/better-auth/plugin/lib/build-collections/users/endpoints/index.d.ts +5 -0
  155. package/dist/better-auth/plugin/lib/build-collections/users/endpoints/index.d.ts.map +1 -0
  156. package/dist/better-auth/plugin/lib/build-collections/users/endpoints/index.js +6 -0
  157. package/dist/better-auth/plugin/lib/build-collections/users/endpoints/refresh-token.d.ts +3 -0
  158. package/dist/better-auth/plugin/lib/build-collections/users/endpoints/refresh-token.d.ts.map +1 -0
  159. package/dist/better-auth/plugin/lib/build-collections/users/endpoints/refresh-token.js +114 -0
  160. package/dist/better-auth/plugin/lib/build-collections/users/endpoints/send-invite-url.d.ts +4 -0
  161. package/dist/better-auth/plugin/lib/build-collections/users/endpoints/send-invite-url.d.ts.map +1 -0
  162. package/dist/better-auth/plugin/lib/build-collections/users/endpoints/send-invite-url.js +64 -0
  163. package/dist/better-auth/plugin/lib/build-collections/users/endpoints/set-admin-role.d.ts +4 -0
  164. package/dist/better-auth/plugin/lib/build-collections/users/endpoints/set-admin-role.d.ts.map +1 -0
  165. package/dist/better-auth/plugin/lib/build-collections/users/endpoints/set-admin-role.js +90 -0
  166. package/dist/better-auth/plugin/lib/build-collections/users/hooks/after-login.d.ts +7 -0
  167. package/dist/better-auth/plugin/lib/build-collections/users/hooks/after-login.d.ts.map +1 -0
  168. package/dist/better-auth/plugin/lib/build-collections/users/hooks/after-login.js +80 -0
  169. package/dist/better-auth/plugin/lib/build-collections/users/hooks/after-logout.d.ts +3 -0
  170. package/dist/better-auth/plugin/lib/build-collections/users/hooks/after-logout.d.ts.map +1 -0
  171. package/dist/better-auth/plugin/lib/build-collections/users/hooks/after-logout.js +79 -0
  172. package/dist/better-auth/plugin/lib/build-collections/users/hooks/before-delete.d.ts +3 -0
  173. package/dist/better-auth/plugin/lib/build-collections/users/hooks/before-delete.d.ts.map +1 -0
  174. package/dist/better-auth/plugin/lib/build-collections/users/hooks/before-delete.js +54 -0
  175. package/dist/better-auth/plugin/lib/build-collections/users/hooks/before-login.d.ts +7 -0
  176. package/dist/better-auth/plugin/lib/build-collections/users/hooks/before-login.d.ts.map +1 -0
  177. package/dist/better-auth/plugin/lib/build-collections/users/hooks/before-login.js +15 -0
  178. package/dist/better-auth/plugin/lib/build-collections/users/hooks/index.d.ts +7 -0
  179. package/dist/better-auth/plugin/lib/build-collections/users/hooks/index.d.ts.map +1 -0
  180. package/dist/better-auth/plugin/lib/build-collections/users/hooks/index.js +8 -0
  181. package/dist/better-auth/plugin/lib/build-collections/users/hooks/on-verified-change.d.ts +3 -0
  182. package/dist/better-auth/plugin/lib/build-collections/users/hooks/on-verified-change.d.ts.map +1 -0
  183. package/dist/better-auth/plugin/lib/build-collections/users/hooks/on-verified-change.js +17 -0
  184. package/dist/better-auth/plugin/lib/build-collections/users/hooks/sync-account.d.ts +3 -0
  185. package/dist/better-auth/plugin/lib/build-collections/users/hooks/sync-account.d.ts.map +1 -0
  186. package/dist/better-auth/plugin/lib/build-collections/users/hooks/sync-account.js +90 -0
  187. package/dist/better-auth/plugin/lib/build-collections/users/index.d.ts +4 -0
  188. package/dist/better-auth/plugin/lib/build-collections/users/index.d.ts.map +1 -0
  189. package/dist/better-auth/plugin/lib/build-collections/users/index.js +333 -0
  190. package/dist/better-auth/plugin/lib/build-collections/utils/collection-schema.d.ts +16 -0
  191. package/dist/better-auth/plugin/lib/build-collections/utils/collection-schema.d.ts.map +1 -0
  192. package/dist/better-auth/plugin/lib/build-collections/utils/collection-schema.js +24 -0
  193. package/dist/better-auth/plugin/lib/build-collections/utils/filter-properties.d.ts +11 -0
  194. package/dist/better-auth/plugin/lib/build-collections/utils/filter-properties.d.ts.map +1 -0
  195. package/dist/better-auth/plugin/lib/build-collections/utils/filter-properties.js +112 -0
  196. package/dist/better-auth/plugin/lib/build-collections/utils/get-timestamp-fields.d.ts +8 -0
  197. package/dist/better-auth/plugin/lib/build-collections/utils/get-timestamp-fields.d.ts.map +1 -0
  198. package/dist/better-auth/plugin/lib/build-collections/utils/get-timestamp-fields.js +31 -0
  199. package/dist/better-auth/plugin/lib/build-collections/utils/model-field-transformations.d.ts +12 -0
  200. package/dist/better-auth/plugin/lib/build-collections/utils/model-field-transformations.d.ts.map +1 -0
  201. package/dist/better-auth/plugin/lib/build-collections/utils/model-field-transformations.js +26 -0
  202. package/dist/better-auth/plugin/lib/build-collections/utils/payload-access.d.ts +18 -0
  203. package/dist/better-auth/plugin/lib/build-collections/utils/payload-access.d.ts.map +1 -0
  204. package/dist/better-auth/plugin/lib/build-collections/utils/payload-access.js +84 -0
  205. package/dist/better-auth/plugin/lib/build-collections/utils/transform-schema-fields-to-payload.d.ts +21 -0
  206. package/dist/better-auth/plugin/lib/build-collections/utils/transform-schema-fields-to-payload.d.ts.map +1 -0
  207. package/dist/better-auth/plugin/lib/build-collections/utils/transform-schema-fields-to-payload.js +95 -0
  208. package/dist/better-auth/plugin/lib/build-collections/verifications.d.ts +4 -0
  209. package/dist/better-auth/plugin/lib/build-collections/verifications.d.ts.map +1 -0
  210. package/dist/better-auth/plugin/lib/build-collections/verifications.js +82 -0
  211. package/dist/better-auth/plugin/lib/get-payload-auth.d.ts +6 -0
  212. package/dist/better-auth/plugin/lib/get-payload-auth.d.ts.map +1 -0
  213. package/dist/better-auth/plugin/lib/get-payload-auth.js +9 -0
  214. package/dist/better-auth/plugin/lib/init-better-auth.d.ts +8 -0
  215. package/dist/better-auth/plugin/lib/init-better-auth.d.ts.map +1 -0
  216. package/dist/better-auth/plugin/lib/init-better-auth.js +16 -0
  217. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/admin-plugin.d.ts +3 -0
  218. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/admin-plugin.d.ts.map +1 -0
  219. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/admin-plugin.js +12 -0
  220. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/api-key-plugin.d.ts +3 -0
  221. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/api-key-plugin.d.ts.map +1 -0
  222. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/api-key-plugin.js +10 -0
  223. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/device-authorization-plugin.d.ts +3 -0
  224. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/device-authorization-plugin.d.ts.map +1 -0
  225. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/device-authorization-plugin.js +8 -0
  226. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/index.d.ts +12 -0
  227. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/index.d.ts.map +1 -0
  228. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/index.js +146 -0
  229. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/oidc-plugin.d.ts +3 -0
  230. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/oidc-plugin.d.ts.map +1 -0
  231. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/oidc-plugin.js +18 -0
  232. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/organizations-plugin.d.ts +3 -0
  233. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/organizations-plugin.d.ts.map +1 -0
  234. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/organizations-plugin.js +34 -0
  235. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/passkey-plugin.d.ts +3 -0
  236. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/passkey-plugin.d.ts.map +1 -0
  237. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/passkey-plugin.js +11 -0
  238. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/sso-plugin.d.ts +3 -0
  239. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/sso-plugin.d.ts.map +1 -0
  240. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/sso-plugin.js +10 -0
  241. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/two-factor-plugin.d.ts +3 -0
  242. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/two-factor-plugin.d.ts.map +1 -0
  243. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/two-factor-plugin.js +11 -0
  244. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/admin-after-role-middleware.d.ts +8 -0
  245. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/admin-after-role-middleware.d.ts.map +1 -0
  246. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/admin-after-role-middleware.js +20 -0
  247. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/admin-before-role-middleware.d.ts +8 -0
  248. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/admin-before-role-middleware.d.ts.map +1 -0
  249. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/admin-before-role-middleware.js +20 -0
  250. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/apply-save-to-jwt-returned.d.ts +14 -0
  251. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/apply-save-to-jwt-returned.d.ts.map +1 -0
  252. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/apply-save-to-jwt-returned.js +38 -0
  253. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/ensure-password-set-before-create.d.ts +8 -0
  254. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/ensure-password-set-before-create.d.ts.map +1 -0
  255. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/ensure-password-set-before-create.js +23 -0
  256. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/password.d.ts +26 -0
  257. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/password.d.ts.map +1 -0
  258. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/password.js +62 -0
  259. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/require-admin-invite-for-sign-up-middleware.d.ts +10 -0
  260. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/require-admin-invite-for-sign-up-middleware.d.ts.map +1 -0
  261. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/require-admin-invite-for-sign-up-middleware.js +42 -0
  262. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/use-admin-invite-after-email-sign-up-middleware.d.ts +10 -0
  263. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/use-admin-invite-after-email-sign-up-middleware.d.ts.map +1 -0
  264. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/use-admin-invite-after-email-sign-up-middleware.js +62 -0
  265. package/dist/better-auth/plugin/lib/set-login-methods.d.ts +5 -0
  266. package/dist/better-auth/plugin/lib/set-login-methods.d.ts.map +1 -0
  267. package/dist/better-auth/plugin/lib/set-login-methods.js +14 -0
  268. package/dist/better-auth/plugin/payload/components/admin-buttons/index.d.ts +10 -0
  269. package/dist/better-auth/plugin/payload/components/admin-buttons/index.d.ts.map +1 -0
  270. package/dist/better-auth/plugin/payload/components/admin-buttons/index.js +116 -0
  271. package/dist/better-auth/plugin/payload/components/admin-buttons/index.scss +36 -0
  272. package/dist/better-auth/plugin/payload/components/admin-invite-button/index.d.ts +11 -0
  273. package/dist/better-auth/plugin/payload/components/admin-invite-button/index.d.ts.map +1 -0
  274. package/dist/better-auth/plugin/payload/components/admin-invite-button/index.js +213 -0
  275. package/dist/better-auth/plugin/payload/components/admin-invite-button/index.scss +136 -0
  276. package/dist/better-auth/plugin/payload/components/login-form/alternative-methods.d.ts +4 -0
  277. package/dist/better-auth/plugin/payload/components/login-form/alternative-methods.d.ts.map +1 -0
  278. package/dist/better-auth/plugin/payload/components/login-form/alternative-methods.js +197 -0
  279. package/dist/better-auth/plugin/payload/components/login-form/context.d.ts +49 -0
  280. package/dist/better-auth/plugin/payload/components/login-form/context.d.ts.map +1 -0
  281. package/dist/better-auth/plugin/payload/components/login-form/context.js +94 -0
  282. package/dist/better-auth/plugin/payload/components/login-form/credentials-form.d.ts +4 -0
  283. package/dist/better-auth/plugin/payload/components/login-form/credentials-form.d.ts.map +1 -0
  284. package/dist/better-auth/plugin/payload/components/login-form/credentials-form.js +167 -0
  285. package/dist/better-auth/plugin/payload/components/login-form/index.d.ts +5 -0
  286. package/dist/better-auth/plugin/payload/components/login-form/index.d.ts.map +1 -0
  287. package/dist/better-auth/plugin/payload/components/login-form/index.js +6 -0
  288. package/dist/better-auth/plugin/payload/components/login-form/index.scss +58 -0
  289. package/dist/better-auth/plugin/payload/components/logout-button.d.ts +5 -0
  290. package/dist/better-auth/plugin/payload/components/logout-button.d.ts.map +1 -0
  291. package/dist/better-auth/plugin/payload/components/logout-button.js +24 -0
  292. package/dist/better-auth/plugin/payload/components/passkeys/add-button.d.ts +9 -0
  293. package/dist/better-auth/plugin/payload/components/passkeys/add-button.d.ts.map +1 -0
  294. package/dist/better-auth/plugin/payload/components/passkeys/add-button.js +122 -0
  295. package/dist/better-auth/plugin/payload/components/passkeys/client.d.ts +3 -0
  296. package/dist/better-auth/plugin/payload/components/passkeys/client.d.ts.map +1 -0
  297. package/dist/better-auth/plugin/payload/components/passkeys/client.js +61 -0
  298. package/dist/better-auth/plugin/payload/components/passkeys/index.d.ts +5 -0
  299. package/dist/better-auth/plugin/payload/components/passkeys/index.d.ts.map +1 -0
  300. package/dist/better-auth/plugin/payload/components/passkeys/index.js +42 -0
  301. package/dist/better-auth/plugin/payload/components/passkeys/index.scss +98 -0
  302. package/dist/better-auth/plugin/payload/components/passkeys/list.d.ts +9 -0
  303. package/dist/better-auth/plugin/payload/components/passkeys/list.d.ts.map +1 -0
  304. package/dist/better-auth/plugin/payload/components/passkeys/list.js +57 -0
  305. package/dist/better-auth/plugin/payload/components/passkeys/types.d.ts +23 -0
  306. package/dist/better-auth/plugin/payload/components/passkeys/types.d.ts.map +1 -0
  307. package/dist/better-auth/plugin/payload/components/passkeys/types.js +3 -0
  308. package/dist/better-auth/plugin/payload/components/rsc-redirect.d.ts +7 -0
  309. package/dist/better-auth/plugin/payload/components/rsc-redirect.d.ts.map +1 -0
  310. package/dist/better-auth/plugin/payload/components/rsc-redirect.js +13 -0
  311. package/dist/better-auth/plugin/payload/components/token-field.d.ts +4 -0
  312. package/dist/better-auth/plugin/payload/components/token-field.d.ts.map +1 -0
  313. package/dist/better-auth/plugin/payload/components/token-field.js +29 -0
  314. package/dist/better-auth/plugin/payload/components/two-factor-auth/index.d.ts +9 -0
  315. package/dist/better-auth/plugin/payload/components/two-factor-auth/index.d.ts.map +1 -0
  316. package/dist/better-auth/plugin/payload/components/two-factor-auth/index.js +347 -0
  317. package/dist/better-auth/plugin/payload/components/two-factor-auth/index.scss +116 -0
  318. package/dist/better-auth/plugin/payload/exports/client.d.ts +7 -0
  319. package/dist/better-auth/plugin/payload/exports/client.d.ts.map +1 -0
  320. package/dist/better-auth/plugin/payload/exports/client.js +8 -0
  321. package/dist/better-auth/plugin/payload/exports/rsc.d.ts +9 -0
  322. package/dist/better-auth/plugin/payload/exports/rsc.d.ts.map +1 -0
  323. package/dist/better-auth/plugin/payload/exports/rsc.js +10 -0
  324. package/dist/better-auth/plugin/payload/utils/generate-admin-invite-url.d.ts +3 -0
  325. package/dist/better-auth/plugin/payload/utils/generate-admin-invite-url.d.ts.map +1 -0
  326. package/dist/better-auth/plugin/payload/utils/generate-admin-invite-url.js +9 -0
  327. package/dist/better-auth/plugin/payload/utils/get-safe-redirect.d.ts +2 -0
  328. package/dist/better-auth/plugin/payload/utils/get-safe-redirect.d.ts.map +1 -0
  329. package/dist/better-auth/plugin/payload/utils/get-safe-redirect.js +22 -0
  330. package/dist/better-auth/plugin/payload/views/admin-login/client.d.ts +23 -0
  331. package/dist/better-auth/plugin/payload/views/admin-login/client.d.ts.map +1 -0
  332. package/dist/better-auth/plugin/payload/views/admin-login/client.js +24 -0
  333. package/dist/better-auth/plugin/payload/views/admin-login/index.d.ts +11 -0
  334. package/dist/better-auth/plugin/payload/views/admin-login/index.d.ts.map +1 -0
  335. package/dist/better-auth/plugin/payload/views/admin-login/index.js +143 -0
  336. package/dist/better-auth/plugin/payload/views/admin-signup/client.d.ts +23 -0
  337. package/dist/better-auth/plugin/payload/views/admin-signup/client.d.ts.map +1 -0
  338. package/dist/better-auth/plugin/payload/views/admin-signup/client.js +185 -0
  339. package/dist/better-auth/plugin/payload/views/admin-signup/index.d.ts +10 -0
  340. package/dist/better-auth/plugin/payload/views/admin-signup/index.d.ts.map +1 -0
  341. package/dist/better-auth/plugin/payload/views/admin-signup/index.js +92 -0
  342. package/dist/better-auth/plugin/payload/views/forgot-password/client.d.ts +7 -0
  343. package/dist/better-auth/plugin/payload/views/forgot-password/client.d.ts.map +1 -0
  344. package/dist/better-auth/plugin/payload/views/forgot-password/client.js +104 -0
  345. package/dist/better-auth/plugin/payload/views/forgot-password/index.d.ts +9 -0
  346. package/dist/better-auth/plugin/payload/views/forgot-password/index.d.ts.map +1 -0
  347. package/dist/better-auth/plugin/payload/views/forgot-password/index.js +61 -0
  348. package/dist/better-auth/plugin/payload/views/reset-password/client.d.ts +11 -0
  349. package/dist/better-auth/plugin/payload/views/reset-password/client.d.ts.map +1 -0
  350. package/dist/better-auth/plugin/payload/views/reset-password/client.js +111 -0
  351. package/dist/better-auth/plugin/payload/views/reset-password/index.d.ts +9 -0
  352. package/dist/better-auth/plugin/payload/views/reset-password/index.d.ts.map +1 -0
  353. package/dist/better-auth/plugin/payload/views/reset-password/index.js +78 -0
  354. package/dist/better-auth/plugin/payload/views/two-factor-verify/client.d.ts +9 -0
  355. package/dist/better-auth/plugin/payload/views/two-factor-verify/client.d.ts.map +1 -0
  356. package/dist/better-auth/plugin/payload/views/two-factor-verify/client.js +79 -0
  357. package/dist/better-auth/plugin/payload/views/two-factor-verify/index.d.ts +10 -0
  358. package/dist/better-auth/plugin/payload/views/two-factor-verify/index.d.ts.map +1 -0
  359. package/dist/better-auth/plugin/payload/views/two-factor-verify/index.js +49 -0
  360. package/dist/better-auth/plugin/types.d.ts +448 -0
  361. package/dist/better-auth/plugin/types.d.ts.map +1 -0
  362. package/dist/better-auth/plugin/types.js +3 -0
  363. package/dist/better-auth/plugin/utils/set.d.ts +40 -0
  364. package/dist/better-auth/plugin/utils/set.d.ts.map +1 -0
  365. package/dist/better-auth/plugin/utils/set.js +84 -0
  366. package/dist/better-auth/scripts/generate-types.d.ts +2 -0
  367. package/dist/better-auth/scripts/generate-types.d.ts.map +1 -0
  368. package/dist/better-auth/scripts/generate-types.js +225 -0
  369. package/dist/better-auth/types.d.ts +3 -0
  370. package/dist/better-auth/types.d.ts.map +1 -0
  371. package/dist/better-auth/types.js +4 -0
  372. package/dist/index.d.ts +2 -0
  373. package/dist/index.d.ts.map +1 -0
  374. package/dist/index.js +4 -0
  375. package/dist/shared/components/icons.d.ts +8 -0
  376. package/dist/shared/components/icons.d.ts.map +1 -0
  377. package/dist/shared/components/icons.js +436 -0
  378. package/dist/shared/components/logo.d.ts +3 -0
  379. package/dist/shared/components/logo.d.ts.map +1 -0
  380. package/dist/shared/components/logo.js +24 -0
  381. package/dist/shared/form/components/submit.d.ts +8 -0
  382. package/dist/shared/form/components/submit.d.ts.map +1 -0
  383. package/dist/shared/form/components/submit.js +23 -0
  384. package/dist/shared/form/fields/text-field.d.ts +9 -0
  385. package/dist/shared/form/fields/text-field.d.ts.map +1 -0
  386. package/dist/shared/form/fields/text-field.js +44 -0
  387. package/dist/shared/form/index.d.ts +28 -0
  388. package/dist/shared/form/index.d.ts.map +1 -0
  389. package/dist/shared/form/index.js +17 -0
  390. package/dist/shared/form/ui/header/index.d.ts +9 -0
  391. package/dist/shared/form/ui/header/index.d.ts.map +1 -0
  392. package/dist/shared/form/ui/header/index.js +23 -0
  393. package/dist/shared/form/ui/header/index.scss +8 -0
  394. package/dist/shared/form/ui/index.d.ts +34 -0
  395. package/dist/shared/form/ui/index.d.ts.map +1 -0
  396. package/dist/shared/form/ui/index.js +70 -0
  397. package/dist/shared/form/ui/index.scss +27 -0
  398. package/dist/shared/form/validation.d.ts +65 -0
  399. package/dist/shared/form/validation.d.ts.map +1 -0
  400. package/dist/shared/form/validation.js +108 -0
  401. package/dist/shared/index.d.ts +3 -0
  402. package/dist/shared/index.d.ts.map +1 -0
  403. package/dist/shared/index.js +4 -0
  404. package/dist/shared/payload/fields/field-copy-button/index.css +47 -0
  405. package/dist/shared/payload/fields/field-copy-button/index.d.ts +4 -0
  406. package/dist/shared/payload/fields/field-copy-button/index.d.ts.map +1 -0
  407. package/dist/shared/payload/fields/field-copy-button/index.js +38 -0
  408. package/dist/shared/payload/fields/generate-uuid-button/index.css +14 -0
  409. package/dist/shared/payload/fields/generate-uuid-button/index.d.ts +4 -0
  410. package/dist/shared/payload/fields/generate-uuid-button/index.d.ts.map +1 -0
  411. package/dist/shared/payload/fields/generate-uuid-button/index.js +26 -0
  412. package/dist/shared/payload/fields/index.d.ts +3 -0
  413. package/dist/shared/payload/fields/index.d.ts.map +1 -0
  414. package/dist/shared/payload/fields/index.js +4 -0
  415. package/dist/shared/utils/regex.d.ts +3 -0
  416. package/dist/shared/utils/regex.d.ts.map +1 -0
  417. package/dist/shared/utils/regex.js +4 -0
  418. package/dist/shared/utils/try-catch.d.ts +12 -0
  419. package/dist/shared/utils/try-catch.d.ts.map +1 -0
  420. package/dist/shared/utils/try-catch.js +17 -0
  421. package/dist/shared/utils/value-or-default.d.ts +10 -0
  422. package/dist/shared/utils/value-or-default.d.ts.map +1 -0
  423. package/dist/shared/utils/value-or-default.js +12 -0
  424. package/package.json +124 -0
@@ -0,0 +1,49 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { MinimalTemplate } from "@payloadcms/next/templates";
3
+ import { cookies } from "next/headers";
4
+ import { redirect } from "next/navigation";
5
+ import React from "react";
6
+ import { adminRoutes, supportedBAPluginIds } from "../../../constants";
7
+ import { valueOrDefaultString } from "../../../../../shared/utils/value-or-default";
8
+ import { getSafeRedirect } from "../../utils/get-safe-redirect";
9
+ import { TwoFactorVerifyForm } from "./client";
10
+ async function TwoFactorVerify({ searchParams, initPageResult, pluginOptions, verificationsSlug }) {
11
+ const { req } = initPageResult;
12
+ const { payload: { config }, payload } = req;
13
+ const { admin: { routes: { login } }, routes: { admin: adminRoute } } = config;
14
+ const cookieStore = await cookies();
15
+ const loginRoute = valueOrDefaultString(login, adminRoutes.adminLogin);
16
+ const redirectUrl = getSafeRedirect(searchParams?.redirect, adminRoute);
17
+ const twoFactorOptions = pluginOptions.betterAuthOptions?.plugins?.find((plugin)=>plugin.id === supportedBAPluginIds.twoFactor)?.options ?? {};
18
+ const twoFactorCookie = cookieStore.get(`${process.env.NODE_ENV === "production" ? "__Secure-" : ""}better-auth.two_factor`)?.value;
19
+ if (!twoFactorCookie) {
20
+ redirect(`${adminRoute}${loginRoute}`);
21
+ }
22
+ const twoFactorVerifyToken = twoFactorCookie.split(".").at(0);
23
+ if (!twoFactorVerifyToken) {
24
+ redirect(`${adminRoute}${loginRoute}`);
25
+ }
26
+ const { totalDocs: isValidTwoFactorToken } = await payload.count({
27
+ collection: verificationsSlug,
28
+ where: {
29
+ identifier: {
30
+ equals: twoFactorVerifyToken
31
+ }
32
+ }
33
+ });
34
+ if (!isValidTwoFactorToken) {
35
+ redirect(`${adminRoute}${loginRoute}`);
36
+ }
37
+ return /*#__PURE__*/ _jsx(MinimalTemplate, {
38
+ className: "two-factor-verify",
39
+ children: /*#__PURE__*/ _jsx(TwoFactorVerifyForm, {
40
+ redirect: redirectUrl,
41
+ twoFactorDigits: twoFactorOptions?.totpOptions?.digits,
42
+ baseURL: pluginOptions.betterAuthOptions?.baseURL,
43
+ basePath: pluginOptions.betterAuthOptions?.basePath
44
+ })
45
+ });
46
+ }
47
+ export default TwoFactorVerify;
48
+
49
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3NyYy9iZXR0ZXItYXV0aC9wbHVnaW4vcGF5bG9hZC92aWV3cy90d28tZmFjdG9yLXZlcmlmeS9pbmRleC50c3giXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgTWluaW1hbFRlbXBsYXRlIH0gZnJvbSBcIkBwYXlsb2FkY21zL25leHQvdGVtcGxhdGVzXCI7XG5pbXBvcnQgeyBjb29raWVzIH0gZnJvbSBcIm5leHQvaGVhZGVyc1wiO1xuaW1wb3J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sU0FBUyxHQUFHa0IsYUFBYUUsWUFBWTtJQUN2QztJQUNBLE1BQU1pQix1QkFBdUJOLGdCQUFnQk8sS0FBSyxDQUFDLEtBQUtDLEVBQUUsQ0FBQztJQUMzRCxJQUFJLENBQUNGLHNCQUFzQjtRQUN6QnJDLFNBQVMsR0FBR2tCLGFBQWFFLFlBQVk7SUFDdkM7SUFDQSxNQUFNLEVBQUVvQixXQUFXQyxxQkFBcUIsRUFBRSxHQUFHLE1BQU01QixRQUFRNkIsS0FBSyxDQUFDO1FBQy9EQyxZQUFZaEM7UUFDWmlDLE9BQU87WUFDTEMsWUFBWTtnQkFDVkMsUUFBUVQ7WUFDVjtRQUNGO0lBQ0Y7SUFDQSxJQUFJLENBQUNJLHVCQUF1QjtRQUMxQnpDLFNBQVMsR0FBR2tCLGFBQWFFLFlBQVk7SUFDdkM7SUFFQSxxQkFDRSxLQUFDdEI7UUFBZ0JpRCxXQUFVO2tCQUN6QixjQUFBLEtBQUN6QztZQUNDTixVQUFVc0I7WUFDVjBCLGlCQUFpQnpCLGtCQUFrQjBCLGFBQWFDO1lBQ2hEQyxTQUFTekMsY0FBY2MsaUJBQWlCLEVBQUUyQjtZQUMxQ0MsVUFBVTFDLGNBQWNjLGlCQUFpQixFQUFFNEI7OztBQUluRDtBQUVBLGVBQWU3QyxnQkFBZ0IifQ==
@@ -0,0 +1,448 @@
1
+ import { BASE_ERROR_CODES } from "@better-auth/core/error";
2
+ import type { AuthContext } from "better-auth";
3
+ import { router } from "better-auth/api";
4
+ import type { DBFieldAttribute } from "better-auth/db";
5
+ import type { BetterAuthOptions as BetterAuthOptionsType, BetterAuthPlugin as BetterAuthPluginType, InferAPI, InferPluginTypes, InferSession, InferUser } from "better-auth/types";
6
+ import type { BasePayload, CollectionConfig, Config, Endpoint, Field, Payload, PayloadRequest } from "payload";
7
+ import { ModelKey } from "../generated-types";
8
+ import { adminRoutes, baPluginSlugs, defaults, loginMethods, socialProviders } from "./constants";
9
+ /**
10
+ * BetterAuth options with the following caveats:
11
+ * - The `database` option is removed as it is configured internally
12
+ * - The `user` `modelName` and `fields` is removed as it is configured internally
13
+ * - The `account` `modelName` and `fields` is removed as it is configured internally
14
+ * - The `session` `modelName` and `fields` is removed as it is configured internally
15
+ * - The `verification` `modelName` and `fields` is removed as it is configured internally
16
+ *
17
+ * @see https://www.better-auth.com/docs/reference/options
18
+ */
19
+ export interface BetterAuthOptions extends Omit<BetterAuthOptionsType, "database" | "user" | "account" | "verification" | "session" | "advanced"> {
20
+ user?: Omit<NonNullable<BetterAuthOptionsType["user"]>, "modelName" | "fields"> | undefined;
21
+ account?: Omit<NonNullable<BetterAuthOptionsType["account"]>, "modelName" | "fields"> | undefined;
22
+ session?: Omit<NonNullable<BetterAuthOptionsType["session"]>, "modelName" | "fields"> | undefined;
23
+ verification?: Omit<NonNullable<BetterAuthOptionsType["verification"]>, "modelName" | "fields"> | undefined;
24
+ advanced?: Omit<NonNullable<BetterAuthOptionsType["advanced"]>, "generateId"> | undefined;
25
+ }
26
+ export interface SanitizedBetterAuthOptions extends Omit<BetterAuthOptionsType, "database"> {
27
+ }
28
+ export type SocialProvider = (typeof socialProviders)[number];
29
+ export type LoginMethod = (typeof loginMethods)[number];
30
+ type PluginCollectionOverrides = {
31
+ [K in keyof typeof baPluginSlugs]?: (options: {
32
+ collection: CollectionConfig;
33
+ }) => CollectionConfig;
34
+ };
35
+ export interface PayloadAuthOptions {
36
+ /**
37
+ * Disable the plugin
38
+ * @default false
39
+ */
40
+ disabled?: boolean;
41
+ /**
42
+ * Disable the default payload auth
43
+ *
44
+ * This will ensure that better-auth handles both admin and frontend auth
45
+ *
46
+ * Admin will make use of custom admin routes for auth and give you more control
47
+ *
48
+ * Note: This will override the option passed in the users collection config
49
+ *
50
+ * Read about this more in the docs
51
+ * @see https://www.payloadauth.com/docs/better-auth#disable-default-payload-auth
52
+ *
53
+ * @default false
54
+ */
55
+ disableDefaultPayloadAuth?: boolean;
56
+ /**
57
+ * Custom admin components when disableDefaultPayloadAuth is true
58
+ *
59
+ * These components will be used to render the login, create first admin, and other auth-related views
60
+ */
61
+ admin?: {
62
+ /**
63
+ * Override which social buttons are shown in the Payload Login / Sign Up view.
64
+ *
65
+ * Provide an array of LoginMethod keys.
66
+ */
67
+ loginMethods?: LoginMethod[];
68
+ };
69
+ /**
70
+ * Debug options
71
+ */
72
+ debug?: {
73
+ /**
74
+ * Enable debug logs
75
+ * @default false
76
+ */
77
+ enableDebugLogs?: boolean;
78
+ /**
79
+ * Log the tables that are needed for better-auth on init
80
+ * @default false
81
+ */
82
+ logTables?: boolean;
83
+ };
84
+ /**
85
+ * Hide the better-authplugin collections from the payload admin UI
86
+ * @default false
87
+ */
88
+ hidePluginCollections?: boolean;
89
+ /**
90
+ * Defines the admin group for collections.
91
+ * @default "Auth"
92
+ */
93
+ collectionAdminGroup?: string;
94
+ /**
95
+ * Require a valid admin invitation for any *public* sign‑up.
96
+ *
97
+ * – Applies to both email/password and social‑provider flows.
98
+ * – Existing users can still sign in; admins can still create users via
99
+ * the Payload UI or server‑side calls.
100
+ * – Ignores provider‑level `disableImplicitSignUp` and `disableSignUp`:
101
+ * with a valid invite the sign‑up proceeds, without one it's blocked.
102
+ * – Also sets `disableImplicitSignUp` for all providers, requiring `requestSignUp` to be true for all `authClient.signIn.social` calls when creating a new account with a provider.
103
+ *
104
+ * Enable when you want OAuth for internal/admin use only and no public
105
+ * registrations at all.
106
+ *
107
+ * @default false
108
+ */
109
+ requireAdminInviteForSignUp?: boolean;
110
+ /**
111
+ * BetterAuth options with the following caveats:
112
+ * - The `database` option is removed as it is configured internally
113
+ * - The `user` `modelName` and `fields` is removed as it is configured internally
114
+ * - The `account` `modelName` and `fields` is removed as it is configured internally
115
+ * - The `session` `modelName` and `fields` is removed as it is configured internally
116
+ * - The `verification` `modelName` and `fields` is removed as it is configured internally
117
+ *
118
+ * @see https://www.better-auth.com/docs/reference/options
119
+ */
120
+ betterAuthOptions?: BetterAuthOptions;
121
+ /**
122
+ * Override plugin configurations
123
+ *
124
+ * Note: TypeScript cannot enforce that only enabled plugins are configured
125
+ * at compile time, but this will be validated at runtime.
126
+ */
127
+ pluginCollectionOverrides?: PluginCollectionOverrides;
128
+ /**
129
+ * Configure the Users collections:
130
+ */
131
+ users?: {
132
+ /**
133
+ * Will set the `modelName` for the `user` table in better-auth
134
+ *
135
+ * and the `slug` for the `users` collection in payload
136
+ *
137
+ * @default 'users'
138
+ */
139
+ slug?: string | undefined;
140
+ /**
141
+ * The default role for users
142
+ *
143
+ * This will be used as the default role for the role field in the users collection
144
+ *
145
+ * If you define this you must also have this role in the roles array
146
+ *
147
+ * This will also be used as the defaultRole option in the better-auth admin plugin if present
148
+ * @see https://www.better-auth.com/docs/plugins/admin#default-role
149
+ * @default "user"
150
+ */
151
+ defaultRole?: string;
152
+ /**
153
+ * The default role for admins
154
+ *
155
+ * This will be used as the default role for when admins sign up in the create first admin view or when inviting new admins
156
+ *
157
+ *
158
+ * @default "admin"
159
+ */
160
+ defaultAdminRole?: string;
161
+ /**
162
+ * All roles for the users collection
163
+ *
164
+ * These will be used to define all the options in the user collection role field
165
+ *
166
+ * Will be merged with the adminRoles array, no need to worry about redefining in adminRoles or duplicates
167
+ *
168
+ * This should match the roles in the better-auth admin plugin if you are using it
169
+ * @see https://www.better-auth.com/docs/plugins/admin#access-control
170
+ *
171
+ * @default ["user"]
172
+ */
173
+ roles?: string[];
174
+ /**
175
+ * Define admin roles for the users collection
176
+ *
177
+ * These roles will be given admin access to all auth collections created by this plugin
178
+ *
179
+ * Note: Will be merged with the roles array, no need to worry about redefining in roles or duplicates
180
+ *
181
+ * Will be also used as the adminRoles option in the better-auth admin plugin if present
182
+ *
183
+ * @see https://www.better-auth.com/docs/plugins/admin#admin-roles
184
+ *
185
+ * @default ["admin"]
186
+ */
187
+ adminRoles?: string[];
188
+ /**
189
+ * Hide the `users` collection from the payload admin UI
190
+ *
191
+ * This will be overwritten if you change the value in the collection overrides option
192
+ */
193
+ hidden?: boolean | undefined;
194
+ /**
195
+ * Define which fields users can update themselves
196
+ *
197
+ * Password field is automatically included and doesn't need to be specified here
198
+ *
199
+ * @example ['name', 'dateOfBirth', 'phoneNumber']
200
+ * @default ['name']
201
+ */
202
+ allowedFields?: string[] | undefined;
203
+ /**
204
+ * Function to override the collection configuration
205
+ *
206
+ * This allows modifying the collection config after it has been built
207
+ * Example use cases include adding saveToJwt to specific fields or
208
+ * modifying field descriptions
209
+ *
210
+ * @param options Object containing the collection config and potentially additional parameters
211
+ * @returns Modified collection config
212
+ */
213
+ collectionOverrides?: (options: {
214
+ collection: CollectionConfig;
215
+ }) => CollectionConfig;
216
+ /**
217
+ * This will block the first on sign up verification email from better-auth.
218
+ * If you are using Payload's userCollection.verify option, you will want to set this to true.
219
+ * Function that will be blocked: options.emailVerificationsendVerificationEmail
220
+ * @default false
221
+ */
222
+ blockFirstBetterAuthVerificationEmail?: boolean;
223
+ };
224
+ /**
225
+ * Configure the Accounts collections:
226
+ */
227
+ accounts?: {
228
+ /**
229
+ * Will set the `modelName` for the `account` table in better-auth
230
+ *
231
+ * and the `slug` for the `accounts` collection in payload
232
+ *
233
+ * @default 'accounts'
234
+ */
235
+ slug?: string | undefined;
236
+ /**
237
+ * Hide the `accounts` collection from the payload admin UI
238
+ */
239
+ hidden?: boolean | undefined;
240
+ /**
241
+ * Function to override the collection configuration
242
+ *
243
+ * This allows modifying the collection config after it has been built
244
+ *
245
+ * @param options Object containing the collection config and potentially additional parameters
246
+ * @returns Modified collection config
247
+ */
248
+ collectionOverrides?: (options: {
249
+ collection: CollectionConfig;
250
+ }) => CollectionConfig;
251
+ };
252
+ /**
253
+ * Configure the Sessions collections:
254
+ */
255
+ sessions?: {
256
+ /**
257
+ * Will set the `modelName` for the `session` table in better-auth
258
+ *
259
+ * and the `slug` for the `sessions` collection in payload
260
+ *
261
+ * @default 'sessions'
262
+ */
263
+ slug?: string | undefined;
264
+ /**
265
+ * Hide the `sessions` collection from the payload admin UI
266
+ */
267
+ hidden?: boolean | undefined;
268
+ /**
269
+ * Function to override the collection configuration
270
+ *
271
+ * This allows modifying the collection config after it has been built
272
+ *
273
+ * @param options Object containing the collection config and potentially additional parameters
274
+ * @returns Modified collection config
275
+ */
276
+ collectionOverrides?: (options: {
277
+ collection: CollectionConfig;
278
+ }) => CollectionConfig;
279
+ };
280
+ /**
281
+ * Configure the Verifications collections:
282
+ */
283
+ verifications?: {
284
+ /**
285
+ * Will set the `modelName` for the `verification` table in better-auth
286
+ *
287
+ * and the `slug` for the `verifications` collection in payload
288
+ *
289
+ * @default 'verifications'
290
+ */
291
+ slug?: string | undefined;
292
+ /**
293
+ * Hide the `verifications` collection from the payload admin UI
294
+ */
295
+ hidden?: boolean | undefined;
296
+ /**
297
+ * Function to override the collection configuration
298
+ *
299
+ * This allows modifying the collection config after it has been built
300
+ *
301
+ * @param options Object containing the collection config and potentially additional parameters
302
+ * @returns Modified collection config
303
+ */
304
+ collectionOverrides?: (options: {
305
+ collection: CollectionConfig;
306
+ }) => CollectionConfig;
307
+ };
308
+ /**
309
+ * Configure the Admin Invitations collections:
310
+ */
311
+ adminInvitations?: {
312
+ /**
313
+ * Will set the `slug` for the `admin-invitations` collection in payload
314
+ *
315
+ * @default 'admin-invitations'
316
+ */
317
+ slug?: string | undefined;
318
+ /**
319
+ * Hide the `admin-invitations` collection from the payload admin UI
320
+ */
321
+ hidden?: boolean | undefined;
322
+ /**
323
+ * This will be used to generate the admin invite url
324
+ *
325
+ * @param options Object containing payload and the token
326
+ * @returns The admin invite url
327
+ */
328
+ generateInviteUrl?: GenerateAdminInviteUrlFn;
329
+ /**
330
+ * This will be used to send the admin invite email
331
+ *
332
+ * @param options Object containing payload, email and the url
333
+ * @returns The admin invite url
334
+ */
335
+ sendInviteEmail?: SendAdminInviteEmailFn;
336
+ /**
337
+ * Function to override the collection configuration
338
+ *
339
+ * This allows modifying the collection config after it has been built
340
+ *
341
+ * @param options Object containing the collection config and potentially additional parameters
342
+ * @returns Modified collection config
343
+ */
344
+ collectionOverrides?: (options: {
345
+ collection: CollectionConfig;
346
+ }) => CollectionConfig;
347
+ };
348
+ }
349
+ export type SendAdminInviteEmailFn = (options: {
350
+ payload: Payload;
351
+ email: string;
352
+ url: string;
353
+ }) => Promise<{
354
+ success: true;
355
+ message?: string;
356
+ } | {
357
+ success: false;
358
+ message: string;
359
+ }>;
360
+ export type GenerateAdminInviteUrlFn = (options: {
361
+ payload: Payload;
362
+ token: string;
363
+ }) => string;
364
+ export type ConfigAdminCustom = {
365
+ betterAuth: {
366
+ adminRoutes: {
367
+ [key in keyof typeof adminRoutes]: string;
368
+ };
369
+ };
370
+ };
371
+ export interface BetterAuthPlugin {
372
+ (config: Config): Config;
373
+ pluginOptions: PayloadAuthOptions;
374
+ }
375
+ export interface PayloadRequestWithBetterAuth<O extends PayloadAuthOptions> extends PayloadRequest {
376
+ payload: BasePayload & {
377
+ betterAuth: BetterAuthReturn<O>;
378
+ };
379
+ }
380
+ export type CollectionHookWithBetterAuth<O extends PayloadAuthOptions, T extends (args: any) => any> = T extends (args: infer A) => infer R ? (args: Omit<A, "req"> & {
381
+ req: PayloadRequestWithBetterAuth<O>;
382
+ }) => R : never;
383
+ export type EndpointWithBetterAuth<O extends PayloadAuthOptions> = Omit<Endpoint, "handler"> & {
384
+ handler: (req: PayloadRequestWithBetterAuth<O>) => Promise<Response> | Response;
385
+ };
386
+ type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
387
+ type PrettifyDeep<T> = {
388
+ [K in keyof T]: T[K] extends (...args: any[]) => any ? T[K] : T[K] extends object ? T[K] extends Array<any> ? T[K] : T[K] extends Date ? T[K] : PrettifyDeep<T[K]> : T[K];
389
+ } & {};
390
+ type InferPluginErrorCodes<O extends BetterAuthOptions> = O["plugins"] extends Array<infer P> ? UnionToIntersection<P extends BetterAuthPluginType ? P["$ERROR_CODES"] extends Record<string, any> ? P["$ERROR_CODES"] : never : never> extends infer R ? [R] extends [never] ? {} : R : {} : {};
391
+ export type RoleArray<O extends readonly string[] = readonly [typeof defaults.userRole]> = O[number][] | null;
392
+ type OverrideRole<T, O extends readonly string[]> = T extends object ? Omit<T, "role"> & {
393
+ role: RoleArray<O>;
394
+ } : T;
395
+ type ExtractBA<O extends PayloadAuthOptions> = NonNullable<O["betterAuthOptions"]>;
396
+ type ExtractRoles<O> = O extends {
397
+ users?: {
398
+ roles?: infer R;
399
+ };
400
+ } ? R extends readonly string[] ? R : readonly [] : readonly [typeof defaults.userRole];
401
+ type BaseErrorCodes = typeof BASE_ERROR_CODES;
402
+ export type BetterAuthReturn<O extends PayloadAuthOptions = PayloadAuthOptions> = {
403
+ handler: (request: Request) => Promise<Response>;
404
+ api: InferAPI<ReturnType<typeof router<ExtractBA<O>>>>["endpoints"];
405
+ options: ExtractBA<O>;
406
+ $ERROR_CODES: InferPluginErrorCodes<ExtractBA<O>> & BaseErrorCodes;
407
+ $context: Promise<AuthContext>;
408
+ $Infer: InferPluginTypes<ExtractBA<O>> extends {
409
+ Session: any;
410
+ } ? InferPluginTypes<ExtractBA<O>> : {
411
+ Session: {
412
+ session: PrettifyDeep<InferSession<ExtractBA<O>>>;
413
+ user: OverrideRole<PrettifyDeep<InferUser<ExtractBA<O>>>, ExtractRoles<O>>;
414
+ };
415
+ } & InferPluginTypes<ExtractBA<O>>;
416
+ };
417
+ export type BetterAuthFunctionOptions<O extends PayloadAuthOptions> = Omit<ExtractBA<O>, "database" | "plugins"> & {
418
+ enableDebugLogs?: boolean;
419
+ plugins: ExtractBA<O>["plugins"];
420
+ };
421
+ export interface BuiltBetterAuthSchema {
422
+ modelName: string;
423
+ fields: Record<string, DBFieldAttribute>;
424
+ order: number;
425
+ }
426
+ export type BetterAuthSchemas = Record<ModelKey, BuiltBetterAuthSchema>;
427
+ export interface BuildCollectionProps {
428
+ resolvedSchemas: BetterAuthSchemas;
429
+ pluginOptions: PayloadAuthOptions;
430
+ incomingCollections: CollectionConfig[];
431
+ }
432
+ export type FieldOverrides<K extends string = string> = {
433
+ [Key in K]?: (field: DBFieldAttribute) => Partial<Field>;
434
+ } & {
435
+ [key: string]: (field: DBFieldAttribute) => Partial<Field>;
436
+ };
437
+ export type FieldWithIds = {
438
+ name?: string;
439
+ custom?: {
440
+ betterAuthFieldKey?: string;
441
+ };
442
+ };
443
+ export type FieldRule = {
444
+ condition?: (field: DBFieldAttribute) => boolean;
445
+ transform: (field: DBFieldAttribute) => Record<string, unknown>;
446
+ };
447
+ export {};
448
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/better-auth/plugin/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,KAAK,EACV,iBAAiB,IAAI,qBAAqB,EAC1C,gBAAgB,IAAI,oBAAoB,EACxC,QAAQ,EACR,gBAAgB,EAChB,YAAY,EACZ,SAAS,EACV,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EACV,WAAW,EACX,gBAAgB,EAChB,MAAM,EACN,QAAQ,EACR,KAAK,EACL,OAAO,EACP,cAAc,EACf,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EACL,WAAW,EACX,aAAa,EACb,QAAQ,EACR,YAAY,EACZ,eAAe,EAChB,MAAM,aAAa,CAAC;AACrB;;;;;;;;;GASG;AACH,MAAM,WAAW,iBACf,SAAQ,IAAI,CACV,qBAAqB,EACrB,UAAU,GAAG,MAAM,GAAG,SAAS,GAAG,cAAc,GAAG,SAAS,GAAG,UAAU,CAC1E;IACD,IAAI,CAAC,EACD,IAAI,CAAC,W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SwibWFwcGluZ3MiOiJBQXVpQkEsV0FHRSJ9
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Deep-sets a value on an object using a dotted-path string.
3
+ *
4
+ * **Path syntax**
5
+ * ──────────────────────────────────────────────────────────
6
+ * token action
7
+ * ------------ ------------------------------------------
8
+ * `foo.bar` create/read plain nested objects
9
+ * `foo.bar[]` *append* `value` to array `foo.bar`
10
+ * `foo.[]bar` *prepend* `value` to array `foo.bar`
11
+ * `foo.bar[2]` replace item `2` of `foo.bar`, creating
12
+ * empty slots if the index is out of bounds
13
+ *
14
+ * Missing objects/arrays are created on the fly.
15
+ * The function mutates `target` in place and returns it so
16
+ * you can chain calls.
17
+ *
18
+ * @typeParam T – target object type
19
+ * @typeParam V – value type
20
+ * @param target Object to mutate
21
+ * @param rawPath Dotted path string (see syntax table)
22
+ * @param value Value to set / append / prepend
23
+ * @returns The original `target` reference
24
+ *
25
+ * @example
26
+ * const o: Record<string, unknown> = {};
27
+ * set(o, 'alpha.beta[2].gamma', 42);
28
+ * // o →
29
+ * // {
30
+ * // alpha: {
31
+ * // beta: [
32
+ * // , // <-- empty slot #0
33
+ * // , // <-- empty slot #1
34
+ * // { gamma: 42 } // <-- slot #2
35
+ * // ]
36
+ * // }
37
+ * // }
38
+ */
39
+ export declare function set<T extends Record<string, unknown>, V = unknown>(target: T, rawPath: string, value: V): T;
40
+ //# sourceMappingURL=set.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"set.d.ts","sourceRoot":"","sources":["../../../../src/better-auth/plugin/utils/set.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,wBAAgB,GAAG,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC,GAAG,OAAO,EAChE,MAAM,EAAE,CAAC,EACT,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,CAAC,GACP,CAAC,CA+DH"}