payload-auth 1.0.2 → 1.1.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 (423) hide show
  1. package/dist/better-auth/adapter/index.d.ts +2 -2
  2. package/dist/better-auth/adapter/index.d.ts.map +1 -1
  3. package/dist/better-auth/adapter/index.js +115 -69
  4. package/dist/better-auth/adapter/transform/index.d.ts +22 -10
  5. package/dist/better-auth/adapter/transform/index.d.ts.map +1 -1
  6. package/dist/better-auth/adapter/transform/index.js +387 -96
  7. package/dist/better-auth/adapter/types.d.ts +2 -1
  8. package/dist/better-auth/adapter/types.d.ts.map +1 -1
  9. package/dist/better-auth/adapter/types.js +1 -1
  10. package/dist/better-auth/plugin/helpers/check-passkey-plugin.d.ts +3 -0
  11. package/dist/better-auth/plugin/helpers/check-passkey-plugin.d.ts.map +1 -0
  12. package/dist/better-auth/plugin/helpers/check-passkey-plugin.js +5 -0
  13. package/dist/better-auth/plugin/helpers/check-username-plugin.d.ts +3 -0
  14. package/dist/better-auth/plugin/helpers/check-username-plugin.d.ts.map +1 -0
  15. package/dist/better-auth/plugin/helpers/check-username-plugin.js +5 -0
  16. package/dist/better-auth/plugin/helpers/generate-verify-email-url.d.ts.map +1 -1
  17. package/dist/better-auth/plugin/helpers/generate-verify-email-url.js +8 -8
  18. package/dist/better-auth/plugin/helpers/get-admin-access.d.ts +8 -0
  19. package/dist/better-auth/plugin/helpers/get-admin-access.d.ts.map +1 -0
  20. package/dist/better-auth/plugin/helpers/get-admin-access.js +22 -0
  21. package/dist/better-auth/plugin/helpers/get-admin-routes.d.ts +14 -0
  22. package/dist/better-auth/plugin/helpers/get-admin-routes.d.ts.map +1 -0
  23. package/dist/better-auth/plugin/helpers/get-admin-routes.js +6 -0
  24. package/dist/better-auth/plugin/helpers/get-all-roles.d.ts +6 -0
  25. package/dist/better-auth/plugin/helpers/get-all-roles.d.ts.map +1 -0
  26. package/dist/better-auth/plugin/helpers/get-all-roles.js +20 -0
  27. package/dist/better-auth/plugin/helpers/get-ip.d.ts +1 -1
  28. package/dist/better-auth/plugin/helpers/get-ip.d.ts.map +1 -1
  29. package/dist/better-auth/plugin/helpers/get-ip.js +14 -14
  30. package/dist/better-auth/plugin/helpers/get-requst-collection.d.ts +3 -0
  31. package/dist/better-auth/plugin/helpers/get-requst-collection.d.ts.map +1 -0
  32. package/dist/better-auth/plugin/helpers/get-requst-collection.js +14 -0
  33. package/dist/better-auth/plugin/helpers/index.d.ts +1 -1
  34. package/dist/better-auth/plugin/helpers/index.js +2 -2
  35. package/dist/better-auth/plugin/{lib → helpers}/prepare-session-data.d.ts +3 -3
  36. package/dist/better-auth/plugin/helpers/prepare-session-data.d.ts.map +1 -0
  37. package/dist/better-auth/plugin/helpers/prepare-session-data.js +42 -0
  38. package/dist/better-auth/plugin/helpers/serialize-cookie.d.ts +4 -4
  39. package/dist/better-auth/plugin/helpers/serialize-cookie.d.ts.map +1 -1
  40. package/dist/better-auth/plugin/helpers/serialize-cookie.js +34 -34
  41. package/dist/better-auth/plugin/index.d.ts +7 -7
  42. package/dist/better-auth/plugin/index.d.ts.map +1 -1
  43. package/dist/better-auth/plugin/index.js +145 -37
  44. package/dist/better-auth/plugin/{collections → lib/build-collections}/accounts/hooks/sync-password-to-user.d.ts +1 -1
  45. package/dist/better-auth/plugin/lib/build-collections/accounts/hooks/sync-password-to-user.d.ts.map +1 -0
  46. package/dist/better-auth/plugin/lib/build-collections/accounts/hooks/sync-password-to-user.js +47 -0
  47. package/dist/better-auth/plugin/lib/build-collections/accounts/index.d.ts +7 -0
  48. package/dist/better-auth/plugin/lib/build-collections/accounts/index.d.ts.map +1 -0
  49. package/dist/better-auth/plugin/lib/build-collections/accounts/index.js +159 -0
  50. package/dist/better-auth/plugin/lib/build-collections/admin-invitations/hooks/get-url-after-read.d.ts +6 -0
  51. package/dist/better-auth/plugin/lib/build-collections/admin-invitations/hooks/get-url-after-read.d.ts.map +1 -0
  52. package/dist/better-auth/plugin/lib/build-collections/admin-invitations/hooks/get-url-after-read.js +11 -0
  53. package/dist/better-auth/plugin/lib/build-collections/admin-invitations/hooks/get-url-before-change.d.ts +3 -0
  54. package/dist/better-auth/plugin/lib/build-collections/admin-invitations/hooks/get-url-before-change.d.ts.map +1 -0
  55. package/dist/better-auth/plugin/lib/build-collections/admin-invitations/hooks/get-url-before-change.js +8 -0
  56. package/dist/better-auth/plugin/lib/build-collections/admin-invitations/index.d.ts +7 -0
  57. package/dist/better-auth/plugin/lib/build-collections/admin-invitations/index.d.ts.map +1 -0
  58. package/dist/better-auth/plugin/lib/build-collections/admin-invitations/index.js +107 -0
  59. package/dist/better-auth/plugin/lib/build-collections/api-keys.d.ts +6 -0
  60. package/dist/better-auth/plugin/lib/build-collections/api-keys.d.ts.map +1 -0
  61. package/dist/better-auth/plugin/lib/build-collections/api-keys.js +196 -0
  62. package/dist/better-auth/plugin/lib/build-collections/index.d.ts +12 -0
  63. package/dist/better-auth/plugin/lib/build-collections/index.d.ts.map +1 -0
  64. package/dist/better-auth/plugin/lib/build-collections/index.js +96 -0
  65. package/dist/better-auth/plugin/lib/build-collections/invitations.d.ts +6 -0
  66. package/dist/better-auth/plugin/lib/build-collections/invitations.d.ts.map +1 -0
  67. package/dist/better-auth/plugin/lib/build-collections/invitations.js +91 -0
  68. package/dist/better-auth/plugin/lib/build-collections/jwks.d.ts +6 -0
  69. package/dist/better-auth/plugin/lib/build-collections/jwks.d.ts.map +1 -0
  70. package/dist/better-auth/plugin/lib/build-collections/jwks.js +43 -0
  71. package/dist/better-auth/plugin/lib/build-collections/members.d.ts +6 -0
  72. package/dist/better-auth/plugin/lib/build-collections/members.d.ts.map +1 -0
  73. package/dist/better-auth/plugin/lib/build-collections/members.js +71 -0
  74. package/dist/better-auth/plugin/lib/build-collections/oauth-access-tokens.d.ts +6 -0
  75. package/dist/better-auth/plugin/lib/build-collections/oauth-access-tokens.d.ts.map +1 -0
  76. package/dist/better-auth/plugin/lib/build-collections/oauth-access-tokens.js +98 -0
  77. package/dist/better-auth/plugin/lib/build-collections/oauth-applications.d.ts +6 -0
  78. package/dist/better-auth/plugin/lib/build-collections/oauth-applications.d.ts.map +1 -0
  79. package/dist/better-auth/plugin/lib/build-collections/oauth-applications.js +113 -0
  80. package/dist/better-auth/plugin/lib/build-collections/oauth-consents.d.ts +6 -0
  81. package/dist/better-auth/plugin/lib/build-collections/oauth-consents.d.ts.map +1 -0
  82. package/dist/better-auth/plugin/lib/build-collections/oauth-consents.js +67 -0
  83. package/dist/better-auth/plugin/lib/build-collections/organizations.d.ts +6 -0
  84. package/dist/better-auth/plugin/lib/build-collections/organizations.d.ts.map +1 -0
  85. package/dist/better-auth/plugin/lib/build-collections/organizations.js +59 -0
  86. package/dist/better-auth/plugin/lib/build-collections/passkeys.d.ts +6 -0
  87. package/dist/better-auth/plugin/lib/build-collections/passkeys.d.ts.map +1 -0
  88. package/dist/better-auth/plugin/lib/build-collections/passkeys.js +108 -0
  89. package/dist/better-auth/plugin/lib/build-collections/sessions.d.ts +8 -0
  90. package/dist/better-auth/plugin/lib/build-collections/sessions.d.ts.map +1 -0
  91. package/dist/better-auth/plugin/lib/build-collections/sessions.js +123 -0
  92. package/dist/better-auth/plugin/lib/build-collections/sso-providers.d.ts +6 -0
  93. package/dist/better-auth/plugin/lib/build-collections/sso-providers.d.ts.map +1 -0
  94. package/dist/better-auth/plugin/lib/build-collections/sso-providers.js +83 -0
  95. package/dist/better-auth/plugin/lib/build-collections/teams.d.ts +6 -0
  96. package/dist/better-auth/plugin/lib/build-collections/teams.d.ts.map +1 -0
  97. package/dist/better-auth/plugin/lib/build-collections/teams.js +45 -0
  98. package/dist/better-auth/plugin/lib/build-collections/two-factors.d.ts +6 -0
  99. package/dist/better-auth/plugin/lib/build-collections/two-factors.d.ts.map +1 -0
  100. package/dist/better-auth/plugin/lib/build-collections/two-factors.js +56 -0
  101. package/dist/better-auth/plugin/lib/build-collections/users/better-auth-strategy.d.ts +8 -0
  102. package/dist/better-auth/plugin/lib/build-collections/users/better-auth-strategy.d.ts.map +1 -0
  103. package/dist/better-auth/plugin/lib/build-collections/users/better-auth-strategy.js +52 -0
  104. package/dist/better-auth/plugin/lib/build-collections/users/endpoints/forgot-password.d.ts +3 -0
  105. package/dist/better-auth/plugin/lib/build-collections/users/endpoints/forgot-password.d.ts.map +1 -0
  106. package/dist/better-auth/plugin/lib/build-collections/users/endpoints/forgot-password.js +96 -0
  107. package/dist/better-auth/plugin/lib/build-collections/users/endpoints/generate-invite-url.d.ts +13 -0
  108. package/dist/better-auth/plugin/lib/build-collections/users/endpoints/generate-invite-url.d.ts.map +1 -0
  109. package/dist/better-auth/plugin/lib/build-collections/users/endpoints/generate-invite-url.js +67 -0
  110. package/dist/better-auth/plugin/lib/build-collections/users/endpoints/login.d.ts +4 -0
  111. package/dist/better-auth/plugin/lib/build-collections/users/endpoints/login.d.ts.map +1 -0
  112. package/dist/better-auth/plugin/lib/build-collections/users/endpoints/login.js +115 -0
  113. package/dist/better-auth/plugin/lib/build-collections/users/endpoints/refresh-token.d.ts +3 -0
  114. package/dist/better-auth/plugin/lib/build-collections/users/endpoints/refresh-token.d.ts.map +1 -0
  115. package/dist/better-auth/plugin/lib/build-collections/users/endpoints/refresh-token.js +110 -0
  116. package/dist/better-auth/plugin/lib/build-collections/users/endpoints/reset-password.d.ts +3 -0
  117. package/dist/better-auth/plugin/lib/build-collections/users/endpoints/reset-password.d.ts.map +1 -0
  118. package/dist/better-auth/plugin/lib/build-collections/users/endpoints/reset-password.js +62 -0
  119. package/dist/better-auth/plugin/lib/build-collections/users/endpoints/send-invite-url.d.ts +3 -0
  120. package/dist/better-auth/plugin/lib/build-collections/users/endpoints/send-invite-url.d.ts.map +1 -0
  121. package/dist/better-auth/plugin/lib/build-collections/users/endpoints/send-invite-url.js +42 -0
  122. package/dist/better-auth/plugin/lib/build-collections/users/endpoints/set-admin-role.d.ts +4 -0
  123. package/dist/better-auth/plugin/lib/build-collections/users/endpoints/set-admin-role.d.ts.map +1 -0
  124. package/dist/better-auth/plugin/lib/build-collections/users/endpoints/set-admin-role.js +79 -0
  125. package/dist/better-auth/plugin/lib/build-collections/users/endpoints/signup.d.ts +4 -0
  126. package/dist/better-auth/plugin/lib/build-collections/users/endpoints/signup.d.ts.map +1 -0
  127. package/dist/better-auth/plugin/lib/build-collections/users/endpoints/signup.js +153 -0
  128. package/dist/better-auth/plugin/{collections → lib/build-collections}/users/hooks/after-login.d.ts +1 -1
  129. package/dist/better-auth/plugin/lib/build-collections/users/hooks/after-login.d.ts.map +1 -0
  130. package/dist/better-auth/plugin/lib/build-collections/users/hooks/after-login.js +75 -0
  131. package/dist/better-auth/plugin/{collections → lib/build-collections}/users/hooks/after-logout.d.ts +1 -1
  132. package/dist/better-auth/plugin/lib/build-collections/users/hooks/after-logout.d.ts.map +1 -0
  133. package/dist/better-auth/plugin/lib/build-collections/users/hooks/after-logout.js +74 -0
  134. package/dist/better-auth/plugin/lib/build-collections/users/hooks/before-delete.d.ts +7 -0
  135. package/dist/better-auth/plugin/lib/build-collections/users/hooks/before-delete.d.ts.map +1 -0
  136. package/dist/better-auth/plugin/lib/build-collections/users/hooks/before-delete.js +45 -0
  137. package/dist/better-auth/plugin/{collections → lib/build-collections}/users/hooks/before-login.d.ts +1 -1
  138. package/dist/better-auth/plugin/lib/build-collections/users/hooks/before-login.d.ts.map +1 -0
  139. package/dist/better-auth/plugin/lib/build-collections/users/hooks/before-login.js +18 -0
  140. package/dist/better-auth/plugin/lib/build-collections/users/hooks/on-verified-change.d.ts +3 -0
  141. package/dist/better-auth/plugin/lib/build-collections/users/hooks/on-verified-change.d.ts.map +1 -0
  142. package/dist/better-auth/plugin/lib/build-collections/users/hooks/on-verified-change.js +14 -0
  143. package/dist/better-auth/plugin/{collections → lib/build-collections}/users/hooks/sync-account.d.ts +1 -1
  144. package/dist/better-auth/plugin/lib/build-collections/users/hooks/sync-account.d.ts.map +1 -0
  145. package/dist/better-auth/plugin/lib/build-collections/users/hooks/sync-account.js +82 -0
  146. package/dist/better-auth/plugin/lib/build-collections/users/index.d.ts +8 -0
  147. package/dist/better-auth/plugin/lib/build-collections/users/index.d.ts.map +1 -0
  148. package/dist/better-auth/plugin/lib/build-collections/users/index.js +345 -0
  149. package/dist/better-auth/plugin/lib/build-collections/utils/get-timestamp-fields.d.ts +8 -0
  150. package/dist/better-auth/plugin/lib/build-collections/utils/get-timestamp-fields.d.ts.map +1 -0
  151. package/dist/better-auth/plugin/lib/build-collections/utils/get-timestamp-fields.js +31 -0
  152. package/dist/better-auth/plugin/lib/{payload-access.d.ts → build-collections/utils/payload-access.d.ts} +1 -1
  153. package/dist/better-auth/plugin/lib/build-collections/utils/payload-access.d.ts.map +1 -0
  154. package/dist/better-auth/plugin/lib/build-collections/utils/payload-access.js +64 -0
  155. package/dist/better-auth/plugin/lib/build-collections/verifications.d.ts +7 -0
  156. package/dist/better-auth/plugin/lib/build-collections/verifications.d.ts.map +1 -0
  157. package/dist/better-auth/plugin/lib/build-collections/verifications.js +63 -0
  158. package/dist/better-auth/plugin/lib/{config.d.ts → constants.d.ts} +13 -1
  159. package/dist/better-auth/plugin/lib/constants.d.ts.map +1 -0
  160. package/dist/better-auth/plugin/lib/constants.js +56 -0
  161. package/dist/better-auth/plugin/lib/get-payload-auth.d.ts +2 -2
  162. package/dist/better-auth/plugin/lib/get-payload-auth.d.ts.map +1 -1
  163. package/dist/better-auth/plugin/lib/get-payload-auth.js +2 -2
  164. package/dist/better-auth/plugin/lib/get-required-collection-slugs.d.ts +4 -4
  165. package/dist/better-auth/plugin/lib/get-required-collection-slugs.d.ts.map +1 -1
  166. package/dist/better-auth/plugin/lib/get-required-collection-slugs.js +26 -43
  167. package/dist/better-auth/plugin/lib/init-better-auth.d.ts +4 -3
  168. package/dist/better-auth/plugin/lib/init-better-auth.d.ts.map +1 -1
  169. package/dist/better-auth/plugin/lib/init-better-auth.js +7 -7
  170. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/admin-plugin.d.ts +3 -0
  171. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/admin-plugin.d.ts.map +1 -0
  172. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/admin-plugin.js +8 -0
  173. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/api-key-plugin.d.ts +2 -0
  174. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/api-key-plugin.d.ts.map +1 -0
  175. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/api-key-plugin.js +17 -0
  176. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/index.d.ts +10 -0
  177. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/index.d.ts.map +1 -0
  178. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/index.js +118 -0
  179. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/oidc-plugin.d.ts +2 -0
  180. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/oidc-plugin.d.ts.map +1 -0
  181. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/oidc-plugin.js +58 -0
  182. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/organizations-plugin.d.ts +2 -0
  183. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/organizations-plugin.d.ts.map +1 -0
  184. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/organizations-plugin.js +86 -0
  185. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/passkey-plugin.d.ts +2 -0
  186. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/passkey-plugin.d.ts.map +1 -0
  187. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/passkey-plugin.js +17 -0
  188. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/sso-plugin.d.ts +2 -0
  189. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/sso-plugin.d.ts.map +1 -0
  190. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/sso-plugin.js +17 -0
  191. package/dist/better-auth/plugin/lib/{ensure-password-set-before-create.d.ts → sanitize-better-auth-options/utils/ensure-password-set-before-create.d.ts} +1 -1
  192. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/ensure-password-set-before-create.d.ts.map +1 -0
  193. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/ensure-password-set-before-create.js +23 -0
  194. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/password.d.ts.map +1 -0
  195. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/password.js +62 -0
  196. package/dist/better-auth/plugin/lib/{respect-save-to-jwt-fields-middleware.d.ts → sanitize-better-auth-options/utils/save-to-jwt-middleware.d.ts} +6 -6
  197. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/save-to-jwt-middleware.d.ts.map +1 -0
  198. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/save-to-jwt-middleware.js +30 -0
  199. package/dist/better-auth/plugin/payload/components/admin-buttons/index.d.ts +8 -0
  200. package/dist/better-auth/plugin/payload/components/admin-buttons/index.d.ts.map +1 -0
  201. package/dist/better-auth/plugin/payload/components/admin-buttons/index.js +115 -0
  202. package/dist/better-auth/plugin/payload/components/admin-buttons/index.scss +31 -0
  203. package/dist/better-auth/plugin/payload/components/admin-invite-button/index.d.ts +11 -0
  204. package/dist/better-auth/plugin/payload/components/admin-invite-button/index.d.ts.map +1 -0
  205. package/dist/better-auth/plugin/payload/components/admin-invite-button/index.js +196 -0
  206. package/dist/better-auth/plugin/payload/components/admin-invite-button/index.scss +131 -0
  207. package/dist/better-auth/plugin/payload/components/admin-social-provider-buttons/index.d.ts +14 -0
  208. package/dist/better-auth/plugin/payload/components/admin-social-provider-buttons/index.d.ts.map +1 -0
  209. package/dist/better-auth/plugin/payload/components/admin-social-provider-buttons/index.js +111 -0
  210. package/dist/better-auth/plugin/payload/components/admin-social-provider-buttons/index.scss +51 -0
  211. package/dist/better-auth/plugin/payload/components/form-header/index.d.ts +9 -0
  212. package/dist/better-auth/plugin/payload/components/form-header/index.d.ts.map +1 -0
  213. package/dist/better-auth/plugin/payload/components/form-header/index.js +23 -0
  214. package/dist/better-auth/plugin/payload/components/form-header/index.scss +8 -0
  215. package/dist/better-auth/plugin/payload/components/icons.d.ts +9 -0
  216. package/dist/better-auth/plugin/payload/components/icons.d.ts.map +1 -0
  217. package/dist/better-auth/plugin/payload/components/icons.js +437 -0
  218. package/dist/better-auth/plugin/payload/components/logo.d.ts +3 -2
  219. package/dist/better-auth/plugin/payload/components/logo.d.ts.map +1 -1
  220. package/dist/better-auth/plugin/payload/components/logo.js +22 -34
  221. package/dist/better-auth/plugin/payload/components/logout-button.d.ts +6 -0
  222. package/dist/better-auth/plugin/payload/components/logout-button.d.ts.map +1 -0
  223. package/dist/better-auth/plugin/payload/components/logout-button.js +27 -0
  224. package/dist/better-auth/plugin/payload/components/rsc-redirect.d.ts +7 -0
  225. package/dist/better-auth/plugin/payload/components/rsc-redirect.d.ts.map +1 -0
  226. package/dist/better-auth/plugin/payload/components/rsc-redirect.js +8 -0
  227. package/dist/better-auth/plugin/payload/components/styles.css +2 -2
  228. package/dist/better-auth/plugin/payload/components/token-field.d.ts +5 -0
  229. package/dist/better-auth/plugin/payload/components/token-field.d.ts.map +1 -0
  230. package/dist/better-auth/plugin/payload/components/token-field.js +30 -0
  231. package/dist/better-auth/plugin/payload/exports/client.d.ts +6 -3
  232. package/dist/better-auth/plugin/payload/exports/client.d.ts.map +1 -1
  233. package/dist/better-auth/plugin/payload/exports/client.js +7 -4
  234. package/dist/better-auth/plugin/payload/exports/rsc.d.ts +9 -5
  235. package/dist/better-auth/plugin/payload/exports/rsc.d.ts.map +1 -1
  236. package/dist/better-auth/plugin/payload/exports/rsc.js +10 -6
  237. package/dist/better-auth/plugin/payload/utils/generate-admin-invite-url.d.ts +3 -0
  238. package/dist/better-auth/plugin/payload/utils/generate-admin-invite-url.d.ts.map +1 -0
  239. package/dist/better-auth/plugin/payload/utils/generate-admin-invite-url.js +8 -0
  240. package/dist/better-auth/plugin/payload/utils/generate-metadata.d.ts +15 -0
  241. package/dist/better-auth/plugin/payload/utils/generate-metadata.d.ts.map +1 -0
  242. package/dist/better-auth/plugin/payload/utils/generate-metadata.js +74 -0
  243. package/dist/better-auth/plugin/payload/utils/get-safe-redirect.d.ts +2 -0
  244. package/dist/better-auth/plugin/payload/utils/get-safe-redirect.d.ts.map +1 -0
  245. package/dist/better-auth/plugin/payload/utils/get-safe-redirect.js +23 -0
  246. package/dist/better-auth/plugin/payload/views/admin-invite/client.d.ts +12 -0
  247. package/dist/better-auth/plugin/payload/views/admin-invite/client.d.ts.map +1 -0
  248. package/dist/better-auth/plugin/payload/views/admin-invite/client.js +92 -0
  249. package/dist/better-auth/plugin/payload/views/admin-invite/index.d.ts +11 -0
  250. package/dist/better-auth/plugin/payload/views/admin-invite/index.d.ts.map +1 -0
  251. package/dist/better-auth/plugin/payload/views/admin-invite/index.js +84 -0
  252. package/dist/better-auth/plugin/payload/views/admin-invite/index.scss +25 -0
  253. package/dist/better-auth/plugin/payload/views/create-first-admin/client.d.ts +14 -0
  254. package/dist/better-auth/plugin/payload/views/create-first-admin/client.d.ts.map +1 -0
  255. package/dist/better-auth/plugin/payload/views/create-first-admin/client.js +95 -0
  256. package/dist/better-auth/plugin/payload/views/create-first-admin/index.d.ts +10 -4
  257. package/dist/better-auth/plugin/payload/views/create-first-admin/index.d.ts.map +1 -1
  258. package/dist/better-auth/plugin/payload/views/create-first-admin/index.js +124 -92
  259. package/dist/better-auth/plugin/payload/views/create-first-admin/index.scss +29 -0
  260. package/dist/better-auth/plugin/payload/views/forgot-password/client.d.ts +8 -0
  261. package/dist/better-auth/plugin/payload/views/forgot-password/client.d.ts.map +1 -0
  262. package/dist/better-auth/plugin/payload/views/forgot-password/client.js +119 -0
  263. package/dist/better-auth/plugin/payload/views/forgot-password/index.d.ts +9 -0
  264. package/dist/better-auth/plugin/payload/views/forgot-password/index.d.ts.map +1 -0
  265. package/dist/better-auth/plugin/payload/views/forgot-password/index.js +69 -0
  266. package/dist/better-auth/plugin/payload/views/forgot-password/index.scss +0 -0
  267. package/dist/better-auth/plugin/payload/views/inactivity/index.d.ts +5 -0
  268. package/dist/better-auth/plugin/payload/views/inactivity/index.d.ts.map +1 -0
  269. package/dist/better-auth/plugin/payload/views/inactivity/index.js +12 -0
  270. package/dist/better-auth/plugin/payload/views/login/form/fields/login-field.d.ts +9 -0
  271. package/dist/better-auth/plugin/payload/views/login/form/fields/login-field.d.ts.map +1 -0
  272. package/dist/better-auth/plugin/payload/views/login/form/fields/login-field.js +54 -0
  273. package/dist/better-auth/plugin/payload/views/login/form/fields/password/index.d.ts +1 -0
  274. package/dist/better-auth/plugin/payload/views/login/form/fields/password/index.d.ts.map +1 -0
  275. package/dist/better-auth/plugin/payload/views/login/form/fields/password/index.js +121 -0
  276. package/dist/better-auth/plugin/payload/views/login/form/fields/password/index.scss +31 -0
  277. package/dist/better-auth/plugin/payload/views/login/form/fields/password/types.d.ts +56 -0
  278. package/dist/better-auth/plugin/payload/views/login/form/fields/password/types.d.ts.map +1 -0
  279. package/dist/better-auth/plugin/payload/views/login/form/fields/password/types.js +3 -0
  280. package/dist/better-auth/plugin/payload/views/login/form/index.d.ts +17 -0
  281. package/dist/better-auth/plugin/payload/views/login/form/index.d.ts.map +1 -0
  282. package/dist/better-auth/plugin/payload/views/login/form/index.js +137 -0
  283. package/dist/better-auth/plugin/payload/views/login/form/index.scss +23 -0
  284. package/dist/better-auth/plugin/payload/views/login/index.d.ts +10 -5
  285. package/dist/better-auth/plugin/payload/views/login/index.d.ts.map +1 -1
  286. package/dist/better-auth/plugin/payload/views/login/index.js +81 -61
  287. package/dist/better-auth/plugin/payload/views/login/index.scss +10 -0
  288. package/dist/better-auth/plugin/payload/views/logout/client.d.ts +8 -0
  289. package/dist/better-auth/plugin/payload/views/logout/client.d.ts.map +1 -0
  290. package/dist/better-auth/plugin/payload/views/logout/client.js +76 -0
  291. package/dist/better-auth/plugin/payload/views/logout/index.d.ts +8 -0
  292. package/dist/better-auth/plugin/payload/views/logout/index.d.ts.map +1 -0
  293. package/dist/better-auth/plugin/payload/views/logout/index.js +14 -0
  294. package/dist/better-auth/plugin/payload/views/logout/index.scss +0 -0
  295. package/dist/better-auth/plugin/payload/views/reset-password/client.d.ts +7 -0
  296. package/dist/better-auth/plugin/payload/views/reset-password/client.d.ts.map +1 -0
  297. package/dist/better-auth/plugin/payload/views/reset-password/client.js +72 -0
  298. package/dist/better-auth/plugin/payload/views/reset-password/index.d.ts +5 -0
  299. package/dist/better-auth/plugin/payload/views/reset-password/index.d.ts.map +1 -0
  300. package/dist/better-auth/plugin/payload/views/reset-password/index.js +81 -0
  301. package/dist/better-auth/plugin/payload/views/reset-password/index.scss +9 -0
  302. package/dist/better-auth/plugin/payload/views/reset-password/metadata.d.ts +3 -0
  303. package/dist/better-auth/plugin/payload/views/reset-password/metadata.d.ts.map +1 -0
  304. package/dist/better-auth/plugin/payload/views/reset-password/metadata.js +11 -0
  305. package/dist/better-auth/plugin/types.d.ts +170 -33
  306. package/dist/better-auth/plugin/types.d.ts.map +1 -1
  307. package/dist/better-auth/plugin/types.js +1 -1
  308. package/dist/clerk/plugin/components/sync-clerk-users-button.d.ts +1 -1
  309. package/dist/clerk/plugin/components/sync-clerk-users-button.d.ts.map +1 -1
  310. package/dist/clerk/utils/clerk-user.d.ts +0 -3
  311. package/dist/clerk/utils/clerk-user.d.ts.map +1 -1
  312. package/dist/clerk/utils/clerk-user.js +1 -3
  313. package/dist/clerk/utils/load-clerk-instance.d.ts +1 -1
  314. package/dist/clerk/utils/load-clerk-instance.d.ts.map +1 -1
  315. package/package.json +13 -13
  316. package/LICENSE.md +0 -17
  317. package/dist/better-auth/adapter/dev/bin/run.d.ts +0 -2
  318. package/dist/better-auth/adapter/dev/bin/run.d.ts.map +0 -1
  319. package/dist/better-auth/adapter/dev/bin/run.js +0 -64
  320. package/dist/better-auth/adapter/dev/bin/schema.d.ts +0 -23
  321. package/dist/better-auth/adapter/dev/bin/schema.d.ts.map +0 -1
  322. package/dist/better-auth/adapter/dev/bin/schema.js +0 -160
  323. package/dist/better-auth/adapter/dev/collections.d.ts +0 -4
  324. package/dist/better-auth/adapter/dev/collections.d.ts.map +0 -1
  325. package/dist/better-auth/adapter/dev/collections.js +0 -212
  326. package/dist/better-auth/adapter/dev/index.d.ts +0 -4
  327. package/dist/better-auth/adapter/dev/index.d.ts.map +0 -1
  328. package/dist/better-auth/adapter/dev/index.js +0 -168
  329. package/dist/better-auth/adapter/test/adapter.test.d.ts +0 -2
  330. package/dist/better-auth/adapter/test/adapter.test.d.ts.map +0 -1
  331. package/dist/better-auth/adapter/test/adapter.test.js +0 -181
  332. package/dist/better-auth/adapter/test/better-auth-adapter-test.d.ts +0 -8
  333. package/dist/better-auth/adapter/test/better-auth-adapter-test.d.ts.map +0 -1
  334. package/dist/better-auth/adapter/test/better-auth-adapter-test.js +0 -425
  335. package/dist/better-auth/adapter/test/schema.test.d.ts +0 -2
  336. package/dist/better-auth/adapter/test/schema.test.d.ts.map +0 -1
  337. package/dist/better-auth/adapter/test/schema.test.js +0 -796
  338. package/dist/better-auth/adapter/test/test_payload1/schema.d.ts +0 -24
  339. package/dist/better-auth/adapter/test/test_payload1/schema.d.ts.map +0 -1
  340. package/dist/better-auth/adapter/test/test_payload1/schema.js +0 -177
  341. package/dist/better-auth/adapter/test/test_payload2/schema.d.ts +0 -24
  342. package/dist/better-auth/adapter/test/test_payload2/schema.d.ts.map +0 -1
  343. package/dist/better-auth/adapter/test/test_payload2/schema.js +0 -167
  344. package/dist/better-auth/adapter/test/test_payload3/schema.d.ts +0 -24
  345. package/dist/better-auth/adapter/test/test_payload3/schema.d.ts.map +0 -1
  346. package/dist/better-auth/adapter/test/test_payload3/schema.js +0 -198
  347. package/dist/better-auth/plugin/collections/accounts/hooks/sync-password-to-user.d.ts.map +0 -1
  348. package/dist/better-auth/plugin/collections/accounts/hooks/sync-password-to-user.js +0 -47
  349. package/dist/better-auth/plugin/collections/users/endpoints/refresh-token.d.ts +0 -7
  350. package/dist/better-auth/plugin/collections/users/endpoints/refresh-token.d.ts.map +0 -1
  351. package/dist/better-auth/plugin/collections/users/endpoints/refresh-token.js +0 -106
  352. package/dist/better-auth/plugin/collections/users/hooks/after-login.d.ts.map +0 -1
  353. package/dist/better-auth/plugin/collections/users/hooks/after-login.js +0 -71
  354. package/dist/better-auth/plugin/collections/users/hooks/after-logout.d.ts.map +0 -1
  355. package/dist/better-auth/plugin/collections/users/hooks/after-logout.js +0 -49
  356. package/dist/better-auth/plugin/collections/users/hooks/before-login.d.ts.map +0 -1
  357. package/dist/better-auth/plugin/collections/users/hooks/before-login.js +0 -18
  358. package/dist/better-auth/plugin/collections/users/hooks/clean-up-user-after-delete.d.ts +0 -6
  359. package/dist/better-auth/plugin/collections/users/hooks/clean-up-user-after-delete.d.ts.map +0 -1
  360. package/dist/better-auth/plugin/collections/users/hooks/clean-up-user-after-delete.js +0 -33
  361. package/dist/better-auth/plugin/collections/users/hooks/on-verified-change.d.ts +0 -3
  362. package/dist/better-auth/plugin/collections/users/hooks/on-verified-change.d.ts.map +0 -1
  363. package/dist/better-auth/plugin/collections/users/hooks/on-verified-change.js +0 -14
  364. package/dist/better-auth/plugin/collections/users/hooks/sync-account.d.ts.map +0 -1
  365. package/dist/better-auth/plugin/collections/users/hooks/sync-account.js +0 -82
  366. package/dist/better-auth/plugin/lib/auth-strategy.d.ts +0 -9
  367. package/dist/better-auth/plugin/lib/auth-strategy.d.ts.map +0 -1
  368. package/dist/better-auth/plugin/lib/auth-strategy.js +0 -48
  369. package/dist/better-auth/plugin/lib/build-collection-configs.d.ts +0 -12
  370. package/dist/better-auth/plugin/lib/build-collection-configs.d.ts.map +0 -1
  371. package/dist/better-auth/plugin/lib/build-collection-configs.js +0 -1558
  372. package/dist/better-auth/plugin/lib/config.d.ts.map +0 -1
  373. package/dist/better-auth/plugin/lib/config.js +0 -44
  374. package/dist/better-auth/plugin/lib/ensure-password-set-before-create.d.ts.map +0 -1
  375. package/dist/better-auth/plugin/lib/ensure-password-set-before-create.js +0 -24
  376. package/dist/better-auth/plugin/lib/password.d.ts.map +0 -1
  377. package/dist/better-auth/plugin/lib/password.js +0 -63
  378. package/dist/better-auth/plugin/lib/payload-access.d.ts.map +0 -1
  379. package/dist/better-auth/plugin/lib/payload-access.js +0 -64
  380. package/dist/better-auth/plugin/lib/prepare-session-data.d.ts.map +0 -1
  381. package/dist/better-auth/plugin/lib/prepare-session-data.js +0 -42
  382. package/dist/better-auth/plugin/lib/respect-save-to-jwt-fields-middleware.d.ts.map +0 -1
  383. package/dist/better-auth/plugin/lib/respect-save-to-jwt-fields-middleware.js +0 -30
  384. package/dist/better-auth/plugin/lib/sanitize-auth-options.d.ts +0 -6
  385. package/dist/better-auth/plugin/lib/sanitize-auth-options.d.ts.map +0 -1
  386. package/dist/better-auth/plugin/lib/sanitize-auth-options.js +0 -298
  387. package/dist/better-auth/plugin/payload/components/admin-buttons.d.ts +0 -7
  388. package/dist/better-auth/plugin/payload/components/admin-buttons.d.ts.map +0 -1
  389. package/dist/better-auth/plugin/payload/components/admin-buttons.js +0 -219
  390. package/dist/better-auth/plugin/payload/components/login-redirect.d.ts +0 -2
  391. package/dist/better-auth/plugin/payload/components/login-redirect.d.ts.map +0 -1
  392. package/dist/better-auth/plugin/payload/components/login-redirect.js +0 -6
  393. package/dist/better-auth/plugin/payload/components/logout.d.ts +0 -3
  394. package/dist/better-auth/plugin/payload/components/logout.d.ts.map +0 -1
  395. package/dist/better-auth/plugin/payload/components/logout.js +0 -61
  396. package/dist/better-auth/plugin/payload/components/sign-in.d.ts +0 -4
  397. package/dist/better-auth/plugin/payload/components/sign-in.d.ts.map +0 -1
  398. package/dist/better-auth/plugin/payload/components/sign-in.js +0 -384
  399. package/dist/better-auth/plugin/payload/components/sign-up.d.ts +0 -7
  400. package/dist/better-auth/plugin/payload/components/sign-up.d.ts.map +0 -1
  401. package/dist/better-auth/plugin/payload/components/sign-up.js +0 -503
  402. package/dist/better-auth/plugin/payload/components/ui/button.d.ts +0 -11
  403. package/dist/better-auth/plugin/payload/components/ui/button.d.ts.map +0 -1
  404. package/dist/better-auth/plugin/payload/components/ui/button.js +0 -42
  405. package/dist/better-auth/plugin/payload/components/ui/card.d.ts +0 -10
  406. package/dist/better-auth/plugin/payload/components/ui/card.d.ts.map +0 -1
  407. package/dist/better-auth/plugin/payload/components/ui/card.js +0 -55
  408. package/dist/better-auth/plugin/payload/components/ui/checkbox.d.ts +0 -5
  409. package/dist/better-auth/plugin/payload/components/ui/checkbox.d.ts.map +0 -1
  410. package/dist/better-auth/plugin/payload/components/ui/checkbox.js +0 -23
  411. package/dist/better-auth/plugin/payload/components/ui/cn.d.ts +0 -3
  412. package/dist/better-auth/plugin/payload/components/ui/cn.d.ts.map +0 -1
  413. package/dist/better-auth/plugin/payload/components/ui/cn.js +0 -7
  414. package/dist/better-auth/plugin/payload/components/ui/input.d.ts +0 -4
  415. package/dist/better-auth/plugin/payload/components/ui/input.d.ts.map +0 -1
  416. package/dist/better-auth/plugin/payload/components/ui/input.js +0 -14
  417. package/dist/better-auth/plugin/payload/components/ui/label.d.ts +0 -5
  418. package/dist/better-auth/plugin/payload/components/ui/label.d.ts.map +0 -1
  419. package/dist/better-auth/plugin/payload/components/ui/label.js +0 -15
  420. package/dist/better-auth/plugin/payload/components/ui/password-input.d.ts +0 -3
  421. package/dist/better-auth/plugin/payload/components/ui/password-input.d.ts.map +0 -1
  422. package/dist/better-auth/plugin/payload/components/ui/password-input.js +0 -55
  423. /package/dist/better-auth/plugin/lib/{password.d.ts → sanitize-better-auth-options/utils/password.d.ts} +0 -0
@@ -1,168 +0,0 @@
1
- import { getPayload as getPayloadBase } from 'payload';
2
- import { buildConfig } from 'payload';
3
- import { postgresAdapter } from '@payloadcms/db-postgres';
4
- export const payloadConfig = buildConfig({
5
- admin: {
6
- user: 'user'
7
- },
8
- secret: 'super-secret-payload-key',
9
- db: postgresAdapter({
10
- pool: {
11
- connectionString: process.env.DATABASE_URL
12
- },
13
- push: false,
14
- transactionOptions: false
15
- }),
16
- collections: [
17
- {
18
- slug: 'user',
19
- admin: {
20
- useAsTitle: 'name'
21
- },
22
- auth: {
23
- disableLocalStrategy: true
24
- },
25
- fields: [
26
- {
27
- name: 'name',
28
- type: 'text',
29
- required: true
30
- },
31
- {
32
- name: 'email',
33
- type: 'email',
34
- required: true,
35
- unique: true
36
- },
37
- {
38
- name: 'emailVerified',
39
- type: 'checkbox',
40
- required: true
41
- },
42
- {
43
- name: 'image',
44
- type: 'text'
45
- }
46
- ],
47
- timestamps: true
48
- },
49
- {
50
- slug: 'account',
51
- admin: {
52
- useAsTitle: 'accountId'
53
- },
54
- fields: [
55
- {
56
- name: 'accountId',
57
- type: 'number',
58
- required: true
59
- },
60
- {
61
- name: 'providerId',
62
- type: 'text'
63
- },
64
- {
65
- name: 'user',
66
- type: 'relationship',
67
- required: true,
68
- relationTo: 'user'
69
- },
70
- {
71
- name: 'accessToken',
72
- type: 'text'
73
- },
74
- {
75
- name: 'refreshToken',
76
- type: 'text'
77
- },
78
- {
79
- name: 'idToken',
80
- type: 'text'
81
- },
82
- {
83
- name: 'accessTokenExpiresAt',
84
- type: 'date'
85
- },
86
- {
87
- name: 'refreshTokenExpiresAt',
88
- type: 'date'
89
- },
90
- {
91
- name: 'scope',
92
- type: 'text'
93
- },
94
- {
95
- name: 'password',
96
- type: 'text'
97
- }
98
- ],
99
- timestamps: true
100
- },
101
- {
102
- slug: 'verification',
103
- admin: {
104
- useAsTitle: 'identifier'
105
- },
106
- fields: [
107
- {
108
- name: 'identifier',
109
- type: 'text',
110
- required: true
111
- },
112
- {
113
- name: 'value',
114
- type: 'text',
115
- required: true
116
- },
117
- {
118
- name: 'expiresAt',
119
- type: 'date',
120
- required: true
121
- }
122
- ],
123
- timestamps: true
124
- },
125
- {
126
- slug: 'session',
127
- admin: {
128
- useAsTitle: 'expiresAt'
129
- },
130
- fields: [
131
- {
132
- name: 'expiresAt',
133
- type: 'date',
134
- required: true
135
- },
136
- {
137
- name: 'token',
138
- type: 'text',
139
- required: true,
140
- unique: true
141
- },
142
- {
143
- name: 'ipAddress',
144
- type: 'text'
145
- },
146
- {
147
- name: 'userAgent',
148
- type: 'text'
149
- },
150
- {
151
- name: 'user',
152
- type: 'relationship',
153
- required: true,
154
- relationTo: 'user'
155
- }
156
- ],
157
- timestamps: true
158
- }
159
- ]
160
- });
161
- export async function getPayload() {
162
- return await getPayloadBase({
163
- config: payloadConfig
164
- });
165
- }
166
- export default payloadConfig;
167
-
168
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9iZXR0ZXItYXV0aC9hZGFwdGVyL2Rldi9pbmRleC50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBnZXRQYXlsb2FkIGFzIGdldFBheWxvYWRCYXNlIH0gZnJvbSAncGF5bG9hZCdcblxuaW1wb3J0IHsgYnVpbGRDb25maWcgfSBmcm9tICdwYXlsb2FkJ1xuaW1wb3J0IHsgcG9zdGdyZXNBZGFwdGVyIH0gZnJvbSAnQHBheWxvYWRjbXMvZGItcG9zdGdyZXMnXG5cbmV4cG9ydCBjb25zdCBwYXlsb2FkQ29uZmlnID0gYnVpbGRDb25maWcoe1xuICBhZG1pbjoge1xuICAgIHVzZXI6ICd1c2VyJyxcbiAgfSxcbiAgc2VjcmV0OiAnc3VwZXItc2VjcmV0LXBheWxvYWQta2V5JyxcbiAgZGI6IHBvc3RncmVzQWRhcHRlcih7XG4gICAgcG9vbDoge1xuICAgICAgY29ubmVjdGlvblN0cmluZzogcHJvY2Vzcy5lbnYuREFUQUJBU0VfVVJMLFxuICAgIH0sXG4gICAgcHVzaDogZmFsc2UsXG4gICAgdHJhbnNhY3Rpb25PcHRpb25zOiBmYWxzZSxcbiAgfSksXG4gIGNvbGxlY3Rpb25zOiBbXG4gICAge1xuICAgICAgc2x1ZzogJ3VzZXInLFxuICAgICAgYWRtaW46IHtcbiAgICAgICAgdXNlQXNUaXRsZTogJ25hbWUnLFxuICAgICAgfSxcbiAgICAgIGF1dGg6IHtcbiAgICAgICAgZGlzYWJsZUxvY2FsU3RyYXRlZ3k6IHRydWUsXG4gICAgICB9LFxuICAgICAgZmllbGRzOiBbXG4gICAgICAgIHtcbiAgICAgICAgICBuYW1lOiAnbmFtZScsXG4gICAgICAgICAgdHlwZTogJ3RleHQnLFxuICAgICAgICAgIHJlcXVpcmVkOiB0cnVlLFxuICAgICAgICB9LFxuICAgICAgICB7XG4gICAgICAgICAgbmFtZTogJ2VtYWlsJyxcbiAgICAgICAgICB0eXBlOiAnZW1haWwnLFxuICAgICAgICAgIHJlcXVpcmVkOiB0cnVlLFxuICAgICAgICAgIHVuaXF1ZTogdHJ1ZSxcbiAgICAgICAgfSxcbiAgICAgICAge1xuICAgICAgICAgIG5hbWU6ICdlbWFpbFZlcmlmaWVkJyxcbiAgICAgICAgICB0eXBlOiAnY2hlY2tib3gnLFxuICAgICAgICAgIHJlcXVpcmVkOiB0cnVlLFxuICAgICAgICB9LFxuICAgICAgICB7XG4gICAgICAgICAgbmFtZTogJ2ltYWdlJyxcbiAgICAgICAgICB0eXBlOiAndGV4dCcsXG4gICAgICAgIH0sXG4gICAgICBdLFxuICAgICAgdGltZXN0YW1wczogdHJ1ZSxcbiAgICB9LFxuICAgIHtcbiAgICAgIHNsdWc6ICdhY2NvdW50JyxcbiAgICAgIGFkbWluOiB7XG4gICAgICAgIHVzZUFzVGl0bGU6ICdhY2NvdW50SWQnLFxuICAgICAgfSxcbiAgICAgIGZpZWxkczogW1xuICAgICAgICB7XG4gICAgICAgICAgbmFtZTogJ2FjY291bnRJZCcsXG4gICAgICAgICAgdHlwZTogJ251bWJlcicsXG4gICAgICAgICAgcmVxdWlyZWQ6IHRydWUsXG4gICAgICAgIH0sXG4gICAgICAgIHtcbiAgICAgICAgICBuYW1lOiAncHJvdmlkZXJJZCcsXG4gICAgICAgICAgdHlwZTogJ3RleHQnLFxuICAgICAgICB9LFxuICAgICAgICB7XG4gICAgICAgICAgbmFtZTogJ3VzZXInLFxuICAgICAgICAgIHR5cGU6ICdyZWxhdGlvbnNoaXAnLFxuICAgICAgICAgIHJlcXVpcmVkOiB0cnVlLFxuICAgICAgICAgIHJlbGF0aW9uVG86ICd1c2VyJyxcbiAgICAgICAgfSxcbiAgICAgICAge1xuICAgICAgICAgIG5hbWU6ICdhY2Nlc3NUb2tlbicsXG4gICAgICAgICAgdHlwZTogJ3RleHQnLFxuICAgICAgICB9LFxuICAgICAgICB7XG4gICAgICAgICAgbmFtZTogJ3JlZnJlc2hUb2tlbicsXG4gICAgICAgICAgdHlwZTogJ3RleHQnLFxuICAgICAgICB9LFxuICAgICAgICB7XG4gICAgICAgICAgbmFtZTogJ2lkVG9rZW4nLFxuICAgICAgICAgIHR5cGU6ICd0ZXh0JyxcbiAgICAgICAgfSxcbiAgICAgICAge1xuICAgICAgICAgIG5hbWU6ICdhY2Nlc3NUb2tlbkV4cGlyZXNBdCcsXG4gICAgICAgICAgdHlwZTogJ2RhdGUnLFxuICAgICAgICB9LFxuICAgICAgICB7XG4gICAgICAgICAgbmFtZTogJ3JlZnJlc2hUb2tlbkV4cGlyZXNBdCcsXG4gICAgICAgICAgdHlwZTogJ2RhdGUnLFxuICAgICAgICB9LFxuICAgICAgICB7XG4gICAgICAgICAgbmFtZTogJ3Njb3BlJyxcbiAgICAgICAgICB0eXBlOiAndGV4dCcsXG4gICAgICAgIH0sXG4gICAgICAgIHtcbiAgICAgICAgICBuYW1lOiAncGFzc3dvcmQnLFxuICAgICAgICAgIHR5cGU6ICd0ZXh0JyxcbiAgICAgICAgfSxcbiAgICAgIF0sXG4gICAgICB0aW1lc3RhbXBzOiB0cnVlLFxuICAgIH0sXG4gICAge1xuICAgICAgc2x1ZzogJ3ZlcmlmaWNhdGlvbicsXG4gICAgICBhZG1pbjoge1xuICAgICAgICB1c2VBc1RpdGxlOiAnaWRlbnRpZmllcicsXG4gICAgICB9LFxuICAgICAgZmllbGRzOiBbXG4gICAgICAgIHtcbiAgICAgICAgICBuYW1lOiAnaWRlbnRpZmllcicsXG4gICAgICAgICAgdHlwZTogJ3RleHQnLFxuICAgICAgICAgIHJlcXVpcmVkOiB0cnVlLFxuICAgICAgICB9LFxuICAgICAgICB7XG4gICAgICAgICAgbmFtZTogJ3ZhbHVlJyxcbiAgICAgICAgICB0eXBlOiAndGV4dCcsXG4gICAgICAgICAgcmVxdWlyZWQ6IHRydWUsXG4gICAgICAgIH0sXG4gICAgICAgIHtcbiAgICAgICAgICBuYW1lOiAnZXhwaXJlc0F0JyxcbiAgICAgICAgICB0eXBlOiAnZGF0ZScsXG4gICAgICAgICAgcmVxdWlyZWQ6IHRydWUsXG4gICAgICAgIH0sXG4gICAgICBdLFxuICAgICAgdGltZXN0YW1wczogdHJ1ZSxcbiAgICB9LFxuICAgIHtcbiAgICAgIHNsdWc6ICdzZXNzaW9uJyxcbiAgICAgIGFkbWluOiB7XG4gICAgICAgIHVzZUFzVGl0bGU6ICdleHBpcmVzQXQnLFxuICAgICAgfSxcbiAgICAgIGZpZWxkczogW1xuICAgICAgICB7XG4gICAgICAgICAgbmFtZTogJ2V4cGlyZXNBdCcsXG4gICAgICAgICAgdHlwZTogJ2RhdGUnLFxuICAgICAgICAgIHJlcXVpcmVkOiB0cnVlLFxuICAgICAgICB9LFxuICAgICAgICB7XG4gICAgICAgICAgbmFtZTogJ3Rva2VuJyxcbiAgICAgICAgICB0eXBlOiAndGV4dCcsXG4gICAgICAgICAgcmVxdWlyZWQ6IHRydWUsXG4gICAgICAgICAgdW5pcXVlOiB0cnVlLFxuICAgICAgICB9LFxuICAgICAgICB7XG4gICAgICAgICAgbmFtZTogJ2lwQWRkcmVzcycsXG4gICAgICAgICAgdHlwZTogJ3RleHQnLFxuICAgICAgICB9LFxuICAgICAgICB7XG4gICAgICAgICAgbmFtZTogJ3VzZXJBZ2VudCcsXG4gICAgICAgICAgdHlwZTogJ3RleHQnLFxuICAgICAgICB9LFxuICAgICAgICB7XG4gICAgICAgICAgbmFtZTogJ3VzZXInLF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0 @@
1
- export {};
2
- //# sourceMappingURL=adapter.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"adapter.test.d.ts","sourceRoot":"","sources":["../../../../src/better-auth/adapter/test/adapter.test.ts"],"names":[],"mappings":""}
@@ -1,181 +0,0 @@
1
- import { betterAuth } from 'better-auth';
2
- import { afterAll, beforeAll, describe, expect, it, test } from 'vitest';
3
- import { payloadAdapter } from 'payload-auth/better-auth/adapter';
4
- import { runAdapterTest } from './better-auth-adapter-test.js';
5
- import { getPayload } from '../dev/index.js';
6
- describe('Handle Payload Adapter', async ()=>{
7
- it('should successfully add the Payload Adapter', async ()=>{
8
- const payload = await getPayload();
9
- const auth = betterAuth({
10
- database: payloadAdapter(payload)
11
- });
12
- expect(auth).toBeDefined();
13
- expect(auth.options.database).toBeDefined();
14
- expect(auth.options.database({}).id).toEqual('payload');
15
- });
16
- });
17
- function deleteAll(payload) {
18
- beforeAll(async ()=>{
19
- // delete all users and sessions
20
- const res = await payload.delete({
21
- collection: 'user',
22
- where: {
23
- id: {
24
- exists: true
25
- }
26
- }
27
- });
28
- console.log('before users: ', res.docs.length, res.errors);
29
- const res2 = await payload.delete({
30
- collection: 'session',
31
- where: {
32
- id: {
33
- exists: true
34
- }
35
- }
36
- });
37
- console.log('before sessions: ', res2.docs.length, res2.errors);
38
- const res3 = await payload.delete({
39
- collection: 'account',
40
- where: {
41
- id: {
42
- exists: true
43
- }
44
- }
45
- });
46
- console.log('before accounts: ', res3.docs.length, res3.errors);
47
- const res4 = await payload.delete({
48
- collection: 'verification',
49
- where: {
50
- id: {
51
- exists: true
52
- }
53
- }
54
- });
55
- console.log('before verification: ', res4.docs.length, res4.errors);
56
- });
57
- afterAll(async ()=>{
58
- const res2 = await payload.delete({
59
- collection: 'session',
60
- where: {
61
- id: {
62
- exists: true
63
- }
64
- }
65
- });
66
- console.log('after sessions: ', res2.docs.length, res2.errors);
67
- const res3 = await payload.delete({
68
- collection: 'account',
69
- where: {
70
- id: {
71
- exists: true
72
- }
73
- }
74
- });
75
- console.log('after accounts: ', res3.docs.length, res3.errors);
76
- const res = await payload.delete({
77
- collection: 'user',
78
- where: {
79
- id: {
80
- exists: true
81
- }
82
- }
83
- });
84
- console.log('after users: ', res.docs.length, res.errors);
85
- const res4 = await payload.delete({
86
- collection: 'verification',
87
- where: {
88
- id: {
89
- exists: true
90
- }
91
- }
92
- });
93
- console.log('after verification: ', res4.docs.length, res4.errors);
94
- });
95
- }
96
- describe('Run BetterAuth Adapter tests', async ()=>{
97
- const payload = await getPayload();
98
- deleteAll(payload);
99
- const adapter = payloadAdapter(payload, {
100
- enableDebugLogs: true
101
- });
102
- await runAdapterTest({
103
- getAdapter: async (customOptions = {
104
- session: {
105
- fields: {
106
- userId: 'user'
107
- }
108
- },
109
- account: {
110
- fields: {
111
- userId: 'user'
112
- }
113
- }
114
- })=>{
115
- return adapter({
116
- ...customOptions
117
- });
118
- },
119
- skipGenerateIdTest: true
120
- });
121
- test('should find many with offset and limit', async ()=>{
122
- // At this point, `user` contains 8 rows.
123
- // offset of 2 returns 6 rows
124
- // limit of 2 returns 2 rows
125
- const res = await adapter({}).findMany({
126
- model: 'user',
127
- offset: 2,
128
- limit: 2
129
- });
130
- expect(res.length).toBe(2);
131
- });
132
- });
133
- describe('Authentication Flow Tests', async ()=>{
134
- const testUser = {
135
- email: 'test-email@email.com',
136
- password: 'password12345',
137
- name: 'Test Name'
138
- };
139
- const payload = await getPayload();
140
- deleteAll(payload);
141
- const auth = betterAuth({
142
- database: payloadAdapter(payload, {
143
- enableDebugLogs: true
144
- }),
145
- emailAndPassword: {
146
- enabled: true
147
- },
148
- session: {
149
- fields: {
150
- userId: 'user'
151
- }
152
- },
153
- account: {
154
- fields: {
155
- userId: 'user'
156
- }
157
- }
158
- });
159
- it('should successfully sign up a new user', async ()=>{
160
- const user = await auth.api.signUpEmail({
161
- body: {
162
- email: testUser.email,
163
- password: testUser.password,
164
- name: testUser.name
165
- }
166
- });
167
- expect(user).toBeDefined();
168
- });
169
- it('should successfully sign in an existing user', async ()=>{
170
- await new Promise((resolve)=>setTimeout(resolve, 2000));
171
- const user = await auth.api.signInEmail({
172
- body: {
173
- email: testUser.email,
174
- password: testUser.password
175
- }
176
- });
177
- expect(user.user).toBeDefined();
178
- });
179
- });
180
-
181
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9iZXR0ZXItYXV0aC9hZGFwdGVyL3Rlc3QvYWRhcHRlci50ZXN0LnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGJldHRlckF1dGgsIHR5cGUgQmV0dGVyQXV0aE9wdGlvbnMgfSBmcm9tICdiZXR0ZXItYXV0aCdcbmltcG9ydCB7IGFmdGVyQWxsLCBiZWZvcmVBbGwsIGRlc2NyaWJlLCBleHBlY3QsIGl0LCB0ZXN0IH0gZnJvbSAndml0ZXN0J1xuaW1wb3J0IHsgcGF5bG9hZEFkYXB0ZXIgfSBmcm9tICdwYXlsb2FkLWF1dGgvYmV0dGVyLWF1dGgvYWRhcHRlcidcbmltcG9ydCB7IHJ1bkFkYXB0ZXJUZXN0IH0gZnJvbSAnLi9iZXR0ZXItYXV0aC1hZGFwdGVyLXRlc3QuanMnXG5pbXBvcnQgeyBnZXRQYXlsb2FkIH0gZnJvbSAnLi4vZGV2L2luZGV4LmpzJ1xuaW1wb3J0IHsgQmFzZVBheWxvYWQgfSBmcm9tICdwYXlsb2FkJ1xuXG5kZXNjcmliZSgnSGFuZGxlIFBheWxvYWQgQWRhcHRlcicsIGFzeW5jICgpID0+IHtcbiAgaXQoJ3Nob3VsZCBzdWNjZXNzZnVsbHkgYWRkIHRoZSBQYXlsb2FkIEFkYXB0ZXInLCBhc3luYyAoKSA9PiB7XG4gICAgY29uc3QgcGF5bG9hZCA9IGF3YWl0IGdldFBheWxvYWQoKVxuXG4gICAgY29uc3QgYXV0aCA9IGJldHRlckF1dGgoe1xuICAgICAg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ksRUFBRXRDLFdBQVc7SUFDL0I7QUFDRiJ9
@@ -1,8 +0,0 @@
1
- import type { Adapter, BetterAuthOptions } from 'better-auth';
2
- interface AdapterTestOptions {
3
- getAdapter: (customOptions?: Omit<BetterAuthOptions, 'database'>) => Promise<Adapter>;
4
- skipGenerateIdTest?: boolean;
5
- }
6
- export declare function runAdapterTest(opts: AdapterTestOptions): Promise<void>;
7
- export {};
8
- //# sourceMappingURL=better-auth-adapter-test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"better-auth-adapter-test.d.ts","sourceRoot":"","sources":["../../../../src/better-auth/adapter/test/better-auth-adapter-test.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAI7D,UAAU,kBAAkB;IAC1B,UAAU,EAAE,CAAC,aAAa,CAAC,EAAE,IAAI,CAAC,iBAAiB,EAAE,UAAU,CAAC,KAAK,OAAO,CAAC,OAAO,CAAC,CAAA;IACrF,kBAAkB,CAAC,EAAE,OAAO,CAAA;CAC7B;AAED,wBAAsB,cAAc,CAAC,IAAI,EAAE,kBAAkB,iBAib5D"}