@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,61 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ import { useConfig } from "@payloadcms/ui";
4
+ import { useCallback, useEffect, useState } from "react";
5
+ import { PassKeyAddButton } from "./add-button";
6
+ import { PasskeyList } from "./list";
7
+ export function PasskeysClient({ initialPasskeys, documentId, currentUserId, passkeySlug, passkeyUserIdFieldName, baseURL, basePath }) {
8
+ const { config: { routes: { api: apiRoute } } } = useConfig();
9
+ const [passkeys, setPasskeys] = useState(initialPasskeys);
10
+ const fetchPasskeys = useCallback(async ()=>{
11
+ const url = `${apiRoute}/${passkeySlug}?where[${passkeyUserIdFieldName}][equals]=${documentId}`;
12
+ const res = await fetch(url, {
13
+ credentials: "include"
14
+ });
15
+ if (!res.ok) return;
16
+ const data = await res.json();
17
+ setPasskeys(data.docs);
18
+ }, [
19
+ apiRoute,
20
+ passkeySlug,
21
+ passkeyUserIdFieldName,
22
+ documentId
23
+ ]);
24
+ useEffect(()=>{
25
+ void fetchPasskeys();
26
+ }, [
27
+ fetchPasskeys
28
+ ]);
29
+ const handleDelete = useCallback(async (id)=>{
30
+ const res = await fetch(`${apiRoute}/${passkeySlug}/${id}`, {
31
+ method: "DELETE",
32
+ credentials: "include"
33
+ });
34
+ if (!res.ok) return;
35
+ void fetchPasskeys();
36
+ }, [
37
+ apiRoute,
38
+ passkeySlug,
39
+ fetchPasskeys
40
+ ]);
41
+ const handleAdd = useCallback(()=>{
42
+ void fetchPasskeys();
43
+ }, [
44
+ fetchPasskeys
45
+ ]);
46
+ return /*#__PURE__*/ _jsxs(_Fragment, {
47
+ children: [
48
+ /*#__PURE__*/ _jsx(PasskeyList, {
49
+ passkeys: passkeys,
50
+ onDelete: handleDelete
51
+ }),
52
+ currentUserId === documentId && /*#__PURE__*/ _jsx(PassKeyAddButton, {
53
+ onAdd: handleAdd,
54
+ baseURL: baseURL,
55
+ basePath: basePath
56
+ })
57
+ ]
58
+ });
59
+ }
60
+
61
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3NyYy9iZXR0ZXItYXV0aC9wbHVnaW4vcGF5bG9hZC9jb21wb25lbnRzL3Bhc3NrZXlzL2NsaWVudC50c3giXSwic291cmNlc0NvbnRlbnQiOlsiXCJ1c2UgY2xpZW50XCI7XG5cbmltcG9ydCB7IHVzZUNvbmZpZyB9IGZyb20gXCJAcGF5bG9hZGNtcy91aVwiO1xuaW1wb3J0IHsgdXNlQ2FsbGJhY2ssIHVzZUVmZmVjdCwgdXNlU3RhdGUgfSBmcm9tIFwicmVhY3RcIjtcbmltcG9ydCB7IFBhc3NLZXlBZGRCdXR0b24gfSBmcm9tIFwiLi9hZGQtYnV0dG9uXCI7XG5pbXBvcnQgeyB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
+ import "./index.scss";
3
+ import type { PasskeysServerComponentProps } from "./types";
4
+ export declare function Passkeys({ ...props }: PasskeysServerComponentProps): Promise<React.JSX.Element | null>;
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/better-auth/plugin/payload/components/passkeys/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,4BAA4B,EAAiB,MAAM,SAAS,CAAC;AAE3E,wBAAsB,QAAQ,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,4BAA4B,qCAuCxE"}
@@ -0,0 +1,42 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import React from "react";
3
+ import { PasskeysClient } from "./client";
4
+ import "./index.scss";
5
+ export async function Passkeys({ ...props }) {
6
+ const { id, passkeySlug, payload, passkeyUserIdFieldName, req, user, pluginOptions } = props;
7
+ if (!id || !passkeySlug || !passkeyUserIdFieldName) return null;
8
+ const { docs: userPasskeys } = await payload.find({
9
+ collection: passkeySlug,
10
+ where: {
11
+ [passkeyUserIdFieldName]: {
12
+ equals: id
13
+ }
14
+ },
15
+ limit: 100,
16
+ req,
17
+ depth: 0
18
+ });
19
+ return /*#__PURE__*/ _jsxs("div", {
20
+ className: "passkeys-field",
21
+ children: [
22
+ /*#__PURE__*/ _jsx("h3", {
23
+ className: "passkeys-field__title",
24
+ style: {
25
+ marginBottom: "0.7rem"
26
+ },
27
+ children: "Passkeys"
28
+ }),
29
+ /*#__PURE__*/ _jsx(PasskeysClient, {
30
+ initialPasskeys: userPasskeys,
31
+ documentId: id,
32
+ currentUserId: user?.id,
33
+ passkeySlug: passkeySlug,
34
+ passkeyUserIdFieldName: passkeyUserIdFieldName,
35
+ baseURL: pluginOptions.betterAuthOptions?.baseURL,
36
+ basePath: pluginOptions.betterAuthOptions?.baseP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lCQUFpQixFQUFFRDtnQkFDMUNFLFVBQVVuQixjQUFja0IsaUJBQWlCLEVBQUVDOzs7O0FBSW5EIn0=
@@ -0,0 +1,98 @@
1
+ @layer payload-default {
2
+ .passkeys-modal {
3
+ position: fixed;
4
+ inset: 0;
5
+ z-index: 1000;
6
+ display: flex;
7
+ align-items: center;
8
+ justify-content: center;
9
+ height: 100%;
10
+
11
+ &:before {
12
+ content: '';
13
+ position: absolute;
14
+ inset: 0;
15
+ background: rgba(0, 0, 0, 0.8);
16
+ z-index: 0;
17
+ }
18
+
19
+ &__wrapper {
20
+ z-index: 1;
21
+ position: relative;
22
+ display: flex;
23
+ flex-direction: column;
24
+ gap: 16px;
25
+ border-radius: 3px;
26
+ border: 1px solid var(--theme-border-color);
27
+ background-color: var(--theme-elevation-50);
28
+ min-width: 340px;
29
+ max-width: 90vw;
30
+ box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
31
+ }
32
+
33
+ &__close-button {
34
+ position: absolute;
35
+ top: 0;
36
+ right: 0;
37
+ margin-block: 0 !important;
38
+ padding: 10px !important;
39
+
40
+ svg {
41
+ width: 24px;
42
+ height: 24px;
43
+ }
44
+ }
45
+
46
+ &__content {
47
+ display: flex;
48
+ flex-direction: column;
49
+ gap: 1.5rem;
50
+ padding: 1.5rem 1.5rem 1rem 1.5rem;
51
+
52
+ h2 {
53
+ font-size: 1.5rem;
54
+ font-weight: 600;
55
+ margin: 0;
56
+ }
57
+
58
+ p {
59
+ margin: 0;
60
+ color: var(--theme-elevation-500);
61
+ }
62
+ }
63
+
64
+ &__input {
65
+ margin-bottom: 1rem;
66
+ }
67
+ }
68
+
69
+ .passkeys-field {
70
+ &__list {
71
+ list-style: disc;
72
+ padding-left: 0;
73
+ row-gap: 1rem;
74
+ display: flex;
75
+ flex-direction: column;
76
+ }
77
+
78
+ &__list-item {
79
+ display: flex;
80
+ background-color: var(--theme-input-bg);
81
+ align-items: center;
82
+ padding: 0.8rem 1rem;
83
+ gap: 0.5rem;
84
+ border: 1px solid var(--theme-elevation-150);
85
+ border-radius: var(--style-radius-m);
86
+ color: var(--theme-elevation-800);
87
+ }
88
+
89
+ &__list-item-date {
90
+ color: var(--theme-elevation-500);
91
+ }
92
+
93
+ &__delete-button {
94
+ margin-block: 0;
95
+ margin-left: auto;
96
+ }
97
+ }
98
+ }
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ import type { PasskeyWithId } from "./types";
3
+ interface PasskeyListProps {
4
+ passkeys: PasskeyWithId[];
5
+ onDelete?: (id: string) => void;
6
+ }
7
+ export declare function PasskeyList({ passkeys, onDelete }: PasskeyListProps): React.JSX.Element;
8
+ export {};
9
+ //# sourceMappingURL=list.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../../../../src/better-auth/plugin/payload/components/passkeys/list.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C,UAAU,gBAAgB;IACxB,QAAQ,EAAE,aAAa,EAAE,CAAC;IAC1B,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CACjC;AAED,wBAAgB,WAAW,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,gBAAgB,qBAuCnE"}
@@ -0,0 +1,57 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import React from "react";
4
+ import { Fingerprint, Trash } from "lucide-react";
5
+ import { Button } from "@payloadcms/ui";
6
+ export function PasskeyList({ passkeys, onDelete }) {
7
+ if (passkeys.length === 0) return /*#__PURE__*/ _jsx("p", {
8
+ style: {
9
+ marginBottom: "1rem"
10
+ },
11
+ children: "No passkeys found."
12
+ });
13
+ return /*#__PURE__*/ _jsx("ul", {
14
+ className: "passkeys-field__list",
15
+ children: passkeys.map((pk)=>{
16
+ const { id, createdAt } = pk;
17
+ if (!id || !createdAt) return null;
18
+ return /*#__PURE__*/ _jsxs("li", {
19
+ className: "passkeys-field__list-item",
20
+ children: [
21
+ /*#__PURE__*/ _jsx(Fingerprint, {
22
+ size: 16
23
+ }),
24
+ /*#__PURE__*/ _jsx("span", {
25
+ children: pk.name || "My Passkey"
26
+ }),
27
+ /*#__PURE__*/ _jsx("span", {
28
+ className: "passkeys-field__list-item-date",
29
+ children: " - "
30
+ }),
31
+ /*#__PURE__*/ _jsx("span", {
32
+ className: "passkeys-field__list-item-date",
33
+ children: new Date(createdAt).toLocaleString("en-US", {
34
+ month: "long",
35
+ day: "numeric",
36
+ year: "numeric",
37
+ hour: "numeric",
38
+ minute: "2-digit",
39
+ hour12: true
40
+ })
41
+ }),
42
+ onDelete && /*#__PURE__*/ _jsx(Button, {
43
+ buttonStyle: "none",
44
+ size: "small",
45
+ className: "passkeys-field__delete-button",
46
+ onClick: ()=>onDelete(id),
47
+ children: /*#__PURE__*/ _jsx(Trash, {
48
+ size: 16
49
+ })
50
+ })
51
+ ]
52
+ }, id);
53
+ })
54
+ });
55
+ }
56
+
57
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3NyYy9iZXR0ZXItYXV0aC9wbHVnaW4vcGF5bG9hZC9jb21wb25lbnRzL3Bhc3NrZXlzL2xpc3QudHN4Il0sInNvdXJjZXNDb250ZW50IjpbIlwidXNlIGNsaWVudFwiO1xuXG5pbXBvcnQgUmVhY3QgZnJvbSBcInJlYWN0XCI7XG5pbXBvcnQgeyBGaW5nZXJwcmludCwgVHJhc2ggfSBmcm9tIFwibHVjaWRlLXJlYWN0XCI7XG5pbXBvcnQgeyBCdXR0b24gfSBmcm9tIFwiQHBheWxvYWRjbXMvdWlcIjtcbmltcG9ydCB0eXBlIHsgUGFzc2tleVdpdGhJZCB9IGZyb20gXCIuL3R5cGVzXCI7XG5cbmludGVyZmFjZSB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ICAgICAgICAgICAgbW9udGg6IFwibG9uZ1wiLFxuICAgICAgICAgICAgICAgIGRheTogXCJudW1lcmljXCIsXG4gICAgICAgICAgICAgICAgeWVhcjogXCJudW1lcmljXCIsXG4gICAgICAgICAgICAgICAgaG91cjogXCJudW1lcmljXCIsXG4gICAgICAgICAgICAgICAgbWludXRlOiBcIjItZGlnaXRcIixcbiAgICAgICAgICAgICAgICBob3VyMTI6IHRydWVcbiAgICAgICAgICAgICAgfSl9XG4gICAgICAgICAgICA8L3NwYW4+XG4gICAgICAgICAgICB7b25EZWxldGUgJiYgKFxuICAgICAgICAgICAgICA8QnV0dG9uXG4gICAgICAgICAgICAgICAgYnV0dG9uU3R5bGU9XCJub25lXCJcbiAgICAgICAgICAgICAgICBzaXplPVwic21hbGxcIlxuICAgICAgICAgICAgICAgIGNsYXNzTmFtZT1cInBhc3NrZXlzLWZpZWxkX19kZWxldGUtYnV0dG9uXCJcbiAgICAgICAgICAgICAgICBvbkNsaWNrPXsoKSA9PiBvbkRlbGV0ZShpZCl9XG4gICAgICAgICAgICAgID5cbiAgICAgICAgICAgICAgICA8VHJhc2ggc2l6ZT17MTZ9IC8+XG4gICAgICAgICAgICAgIDwvQnV0dG9uPlxuICAgICAgICAgICAgKX1cbiAgICAgICAgICA8L2xpPlxuICAgICAgICApO1xuICAgICAgfSl9XG4gICAgPC91bD5cbiAgKTtcbn1cbiJdLCJuYW1lcyI6WyJSZWFjdCIsIkZpbmdlcnByaW50IiwiVHJhc2giLCJCdXR0b24iLCJQYXNza2V5TGlzdCIsInBhc3NrZXlzIiwib25EZWxldGUiLCJsZW5ndGgiLCJwIiwic3R5bGUiLCJtYXJnaW5Cb3R0b20iLCJ1bCIsImNsYXNzTmFtZSIsIm1hcCIsInBrIiwiaWQiLCJjcmVhdGVkQXQiLCJsaSIsInNpemUiLCJzcGFuIiwibmFtZSIsIkRhdGUiLCJ0b0xvY2FsZVN0cmluZyIsIm1vbnRoIiwiZGF5IiwieWVhciIsImhvdXI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RXhCLGNBQUEsS0FBQ2I7NEJBQU1nQixNQUFNOzs7O2VBckJWSDtRQTBCYjs7QUFHTiJ9
@@ -0,0 +1,23 @@
1
+ import type { UIFieldServerProps } from "payload";
2
+ import type { Passkey } from "@/better-auth/generated-types";
3
+ import type { BuiltBetterAuthSchema, PayloadAuthOptions } from "@/better-auth/types";
4
+ export type PasskeyWithId = Passkey & {
5
+ id: string;
6
+ createdAt: Date;
7
+ };
8
+ export interface PasskeysServerComponentProps extends UIFieldServerProps {
9
+ schema: BuiltBetterAuthSchema;
10
+ passkeySlug: string;
11
+ passkeyUserIdFieldName: string;
12
+ pluginOptions: PayloadAuthOptions;
13
+ }
14
+ export interface PasskeysClientComponentProps {
15
+ initialPasskeys: PasskeyWithId[];
16
+ documentId: string | number;
17
+ currentUserId: string | number;
18
+ passkeySlug: string;
19
+ passkeyUserIdFieldName: string;
20
+ baseURL?: string;
21
+ basePath?: string;
22
+ }
23
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/better-auth/plugin/payload/components/passkeys/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,KAAK,EACV,qBAAqB,EACrB,kBAAkB,EACnB,MAAM,qBAAqB,CAAC;AAE7B,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,IAAI,CAAA;CAAE,CAAC;AAEtE,MAAM,WAAW,4BAA6B,SAAQ,kBAAkB;IACtE,MAAM,EAAE,qBAAqB,CAAC;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,sBAAsB,EAAE,MAAM,CAAC;IAC/B,aAAa,EAAE,kBAAkB,CAAC;CACnC;AAED,MAAM,WAAW,4BAA4B;IAC3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bk9wdGlvbnM6IFBheWxvYWRBdXRoT3B0aW9ucztcbn1cblxuZXhwb3J0IGludGVyZmFjZSBQYXNza2V5c0NsaWVudENvbXBvbmVudFByb3BzIHtcbiAgaW5pdGlhbFBhc3NrZXlzOiBQYXNza2V5V2l0aElkW107XG4gIGRvY3VtZW50SWQ6IHN0cmluZyB8IG51bWJlcjtcbiAgY3VycmVudFVzZXJJZDogc3RyaW5nIHwgbnVtYmVyO1xuICBwYXNza2V5U2x1Zzogc3RyaW5nO1xuICBwYXNza2V5VXNlcklkRmllbGROYW1lOiBzdHJpbmc7XG4gIGJhc2VVUkw/OiBzdHJpbmc7XG4gIGJhc2VQYXRoPzogc3RyaW5nO1xufVxuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQWdCQSxXQVFDIn0=
@@ -0,0 +1,7 @@
1
+ type RSCRedirectProps = {
2
+ redirectTo: string;
3
+ searchParams?: Record<string, string | string[]>;
4
+ };
5
+ declare function RSCRedirect({ redirectTo, searchParams }: RSCRedirectProps): void;
6
+ export default RSCRedirect;
7
+ //# sourceMappingURL=rsc-redirect.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rsc-redirect.d.ts","sourceRoot":"","sources":["../../../../../src/better-auth/plugin/payload/components/rsc-redirect.tsx"],"names":[],"mappings":"AAGA,KAAK,gBAAgB,GAAG;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAC;CAClD,CAAC;AAEF,iBAAS,WAAW,CAAC,EAAE,UAAU,EAAE,YAAY,EAAE,EAAE,gBAAgB,QAOlE;AAED,eAAe,WAAW,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { redirect } from "next/navigation";
2
+ import React from "react";
3
+ function RSCRedirect({ redirectTo, searchParams }) {
4
+ // Forward the redirect query param if present
5
+ const redirectParam = searchParams?.redirect;
6
+ if (redirectParam && typeof redirectParam === "string") {
7
+ redirect(`${redirectTo}?redirect=${encodeURIComponent(redirectParam)}`);
8
+ }
9
+ redirect(redirectTo);
10
+ }
11
+ export default RSCRedirect;
12
+
13
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3NyYy9iZXR0ZXItYXV0aC9wbHVnaW4vcGF5bG9hZC9jb21wb25lbnRzL3JzYy1yZWRpcmVjdC50c3giXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgcmVkaXJlY3QgfSBmcm9tIFwibmV4dC9uYXZpZ2F0aW9uXCI7XG5pbXBvcnQgUmVhY3QgZnJvbSBcInJlYWN0XCI7XG5cbnR5cGUgUlNDUmVkaXJlY3RQcm9wcyA9IHtcbiAgcmVkaXJlY3RUbzogc3RyaW5nO1xuICBzZWFyY2hQYXJhbXM/OiBSZWNvcmQ8c3RyaW5nLCBzdHJpbmcgfCBzdHJpbmdbXT47XG59O1xuXG5mdW5jdGlvbiBSU0NSZWRpcmVjdCh7IHJlZGlyZWN0VG8sIHNlYXJjaFBhcmFtcyB9OiBSU0NSZWRpcmVjdFByb3BzKSB7XG4gIC8vIEZvcndhcmQgdGhlIHJlZGlyZWN0IHF1ZXJ5IHBhcmFtIGlmIHByZXNlbnRcbiAgY29uc3QgcmVkaXJlY3RQYXJhbSA9IHNlYXJjaFBhcmFtcz8ucmVkaXJlY3Q7XG4gIGlmIChyZWRpcmVjdFBhcmFtICYmIHR5cGVvZiByZWRpcmVjdFBhcmFtID09PSBcInN0cmluZ1wiKSB7XG4gICAgcmVkaXJlY3QoYCR7cmVkaXJlY3RUb30/cmVkaXJlY3Q9JHtlbmNvZGVVUklDb21wb25lbnQocmVkaXJlY3RQYXJhbSl9YCk7XG4gIH1cbiAgcmVkaXJlY3QocmVkaXJlY3RUbyk7XG59XG5cbmV4cG9ydCBkZWZhdWx0IFJTQ1JlZGlyZWN0O1xuIl0sIm5hbWVzIjpbInJlZGlyZWN0IiwiUmVhY3QiLCJSU0NSZWRpcmVjdCIsInJlZGlyZWN0VG8iLCJzZWFyY2hQYXJhbXMiLCJyZWRpcmVjdFBhcmFtIiwiZW5jb2RlVVJJQ29tcG9uZW50Il0sIm1hcHBpbmdzIjoiQUFBQSxTQUFTQSxRQUFRLFFBQVEsa0JBQWtCO0FBQzNDLE9BQU9DLFdBQVcsUUFBUTtBQU8xQixTQUFTQyxZQUFZLEVBQUVDLFVBQVUsRUFBRUMsWUFBWSxFQUFvQjtJQUNqRSw4Q0FBOEM7SUFDOUMsTUFBTUMsZ0JBQWdCRCxjQUFjSjtJQUNwQyxJQUFJSyxpQkFBaUIsT0FBT0Esa0JBQWtCLFVBQVU7UUFDdERMLFNBQVMsR0FBR0csV0FBVyxVQUFVLEVBQUVHLG1CQUFtQkQsZ0JBQWdCO0lBQ3hFO0lBQ0FMLFNBQVNHO0FBQ1g7QUFFQSxlQUFlRCxZQUFZIn0=
@@ -0,0 +1,4 @@
1
+ import { TextFieldClientProps } from "payload";
2
+ declare function AdminInviteTokenField({ ...props }: TextFieldClientProps): import("react").JSX.Element;
3
+ export default AdminInviteTokenField;
4
+ //# sourceMappingURL=token-field.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"token-field.d.ts","sourceRoot":"","sources":["../../../../../src/better-auth/plugin/payload/components/token-field.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAE/C,iBAAS,qBAAqB,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,oBAAoB,+BAoBhE;AAED,eAAe,qBAAqB,CAAC"}
@@ -0,0 +1,29 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { Button, TextInput, useField, useFormFields } from "@payloadcms/ui";
4
+ function AdminInviteTokenField({ ...props }) {
5
+ const { path } = props;
6
+ const { setValue } = useField({
7
+ path
8
+ });
9
+ const token = useFormFields(([fields])=>fields.token);
10
+ const value = token.value ?? "";
11
+ return /*#__PURE__*/ _jsxs("div", {
12
+ children: [
13
+ /*#__PURE__*/ _jsx(Button, {
14
+ onClick: ()=>setValue(crypto.randomUUID()),
15
+ children: "Generate Token"
16
+ }),
17
+ /*#__PURE__*/ _jsx(TextInput, {
18
+ path: path,
19
+ readOnly: true,
20
+ label: "Token",
21
+ placeholder: "Click 'Generate Token' to create a token",
22
+ value: value
23
+ })
24
+ ]
25
+ });
26
+ }
27
+ export default AdminInviteTokenField;
28
+
29
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3NyYy9iZXR0ZXItYXV0aC9wbHVnaW4vcGF5bG9hZC9jb21wb25lbnRzL3Rva2VuLWZpZWxkLnRzeCJdLCJzb3VyY2VzQ29udGVudCI6WyJcInVzZSBjbGllbnRcIjtcblxuaW1wb3J0IHsgQnV0dG9uLCBUZXh0SW5wdXQsIHVzZUZpZWxkLCB1c2VGb3JtRmllbGRzIH0gZnJvbSBcIkBwYXlsb2FkY21zL3VpXCI7XG5pbXBvcnQgeyBUZXh0RmllbGRDbGllbnRQcm9wcyB9IGZyb20gXCJwYXlsb2FkXCI7XG5cbmZ1bmN0aW9uIEFkbWluSW52aXRlVG9rZW5GaWVsZCh7IC4uLnByb3BzIH06IFRleHRGaWVsZENsaWVudFByb3BzKSB7XG4gIGNvbnN0IHsgcGF0aCB9ID0gcHJvcHM7XG4gIGNvbnN0IHsgc2V0VmFsdWUgfSA9IHVzZUZpZWxkKHsgcGF0aCB9KTtcbiAgY29uc3QgdG9rZW4gPSB1c2VGb3JtRmllbGRzKChbZmllbGRzXSkgPT4gZmllbGRzLnRva2VuKTtcbiAgY29uc3QgdmFsdWUgPSAodG9rZW4udmFsdWUgYXMgc3RyaW5nKSA/PyBcIlwiO1xuXG4gIHJldHVybiAoXG4gICAgPGRpdj5cbiAgICAgIDxCdXR0b24gb25DbGljaz17KCkgPT4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QUFLLElBQWU7SUFFekMscUJBQ0UsTUFBQ0M7OzBCQUNDLEtBQUNYO2dCQUFPWSxTQUFTLElBQU1MLFNBQVNNLE9BQU9DLFVBQVU7MEJBQUs7OzBCQUd0RCxLQUFDYjtnQkFDQ0ssTUFBTUE7Z0JBQ05TLFFBQVE7Z0JBQ1JDLE9BQU07Z0JBQ05DLGFBQVk7Z0JBQ1pQLE9BQU9BOzs7O0FBSWY7QUFFQSxlQUFlTixzQkFBc0IifQ==
@@ -0,0 +1,9 @@
1
+ import "./index.scss";
2
+ import React from "react";
3
+ interface TwoFactorAuthProps {
4
+ baseURL?: string;
5
+ basePath?: string;
6
+ }
7
+ export declare function TwoFactorAuth({ baseURL, basePath }: TwoFactorAuthProps): React.JSX.Element;
8
+ export {};
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/better-auth/plugin/payload/components/two-factor-auth/index.tsx"],"names":[],"mappings":"AAEA,OAAO,cAAc,CAAC;AAetB,OAAO,KAA4B,MAAM,OAAO,CAAC;AAQjD,UAAU,kBAAkB;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,aAAa,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,kBAAkB,qBAiUtE"}