better-auth 1.3.13 → 1.3.15

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 (269) hide show
  1. package/dist/adapters/drizzle-adapter/index.d.cts +1 -1
  2. package/dist/adapters/drizzle-adapter/index.d.mts +1 -1
  3. package/dist/adapters/drizzle-adapter/index.d.ts +1 -1
  4. package/dist/adapters/index.d.cts +2 -2
  5. package/dist/adapters/index.d.mts +2 -2
  6. package/dist/adapters/index.d.ts +2 -2
  7. package/dist/adapters/kysely-adapter/index.cjs +1 -1
  8. package/dist/adapters/kysely-adapter/index.d.cts +1 -1
  9. package/dist/adapters/kysely-adapter/index.d.mts +1 -1
  10. package/dist/adapters/kysely-adapter/index.d.ts +1 -1
  11. package/dist/adapters/kysely-adapter/index.mjs +1 -1
  12. package/dist/adapters/memory-adapter/index.cjs +1 -1
  13. package/dist/adapters/memory-adapter/index.d.cts +1 -1
  14. package/dist/adapters/memory-adapter/index.d.mts +1 -1
  15. package/dist/adapters/memory-adapter/index.d.ts +1 -1
  16. package/dist/adapters/memory-adapter/index.mjs +1 -1
  17. package/dist/adapters/mongodb-adapter/index.d.cts +1 -1
  18. package/dist/adapters/mongodb-adapter/index.d.mts +1 -1
  19. package/dist/adapters/mongodb-adapter/index.d.ts +1 -1
  20. package/dist/adapters/prisma-adapter/index.d.cts +1 -1
  21. package/dist/adapters/prisma-adapter/index.d.mts +1 -1
  22. package/dist/adapters/prisma-adapter/index.d.ts +1 -1
  23. package/dist/adapters/test.d.cts +1 -1
  24. package/dist/adapters/test.d.mts +1 -1
  25. package/dist/adapters/test.d.ts +1 -1
  26. package/dist/api/index.cjs +3 -3
  27. package/dist/api/index.d.cts +1 -1
  28. package/dist/api/index.d.mts +1 -1
  29. package/dist/api/index.d.ts +1 -1
  30. package/dist/api/index.mjs +5 -5
  31. package/dist/client/index.cjs +3 -3
  32. package/dist/client/index.d.cts +3 -3
  33. package/dist/client/index.d.mts +3 -3
  34. package/dist/client/index.d.ts +3 -3
  35. package/dist/client/index.mjs +3 -3
  36. package/dist/client/plugins/index.d.cts +3 -3
  37. package/dist/client/plugins/index.d.mts +3 -3
  38. package/dist/client/plugins/index.d.ts +3 -3
  39. package/dist/client/react/index.cjs +2 -2
  40. package/dist/client/react/index.d.cts +3 -3
  41. package/dist/client/react/index.d.mts +3 -3
  42. package/dist/client/react/index.d.ts +3 -3
  43. package/dist/client/react/index.mjs +2 -2
  44. package/dist/client/solid/index.cjs +2 -2
  45. package/dist/client/solid/index.d.cts +9 -9
  46. package/dist/client/solid/index.d.mts +9 -9
  47. package/dist/client/solid/index.d.ts +9 -9
  48. package/dist/client/solid/index.mjs +2 -2
  49. package/dist/client/svelte/index.cjs +2 -2
  50. package/dist/client/svelte/index.d.cts +3 -3
  51. package/dist/client/svelte/index.d.mts +3 -3
  52. package/dist/client/svelte/index.d.ts +3 -3
  53. package/dist/client/svelte/index.mjs +2 -2
  54. package/dist/client/vue/index.cjs +2 -2
  55. package/dist/client/vue/index.d.cts +3 -3
  56. package/dist/client/vue/index.d.mts +3 -3
  57. package/dist/client/vue/index.d.ts +3 -3
  58. package/dist/client/vue/index.mjs +2 -2
  59. package/dist/cookies/index.cjs +1 -1
  60. package/dist/cookies/index.d.cts +1 -1
  61. package/dist/cookies/index.d.mts +1 -1
  62. package/dist/cookies/index.d.ts +1 -1
  63. package/dist/cookies/index.mjs +1 -1
  64. package/dist/db/index.cjs +3 -3
  65. package/dist/db/index.d.cts +2 -2
  66. package/dist/db/index.d.mts +2 -2
  67. package/dist/db/index.d.ts +2 -2
  68. package/dist/db/index.mjs +3 -3
  69. package/dist/index.cjs +7 -7
  70. package/dist/index.d.cts +4 -4
  71. package/dist/index.d.mts +4 -4
  72. package/dist/index.d.ts +4 -4
  73. package/dist/index.mjs +7 -7
  74. package/dist/integrations/next-js.cjs +4 -4
  75. package/dist/integrations/next-js.d.cts +1 -1
  76. package/dist/integrations/next-js.d.mts +1 -1
  77. package/dist/integrations/next-js.d.ts +1 -1
  78. package/dist/integrations/next-js.mjs +4 -4
  79. package/dist/integrations/node.d.cts +1 -1
  80. package/dist/integrations/node.d.mts +1 -1
  81. package/dist/integrations/node.d.ts +1 -1
  82. package/dist/integrations/react-start.cjs +4 -4
  83. package/dist/integrations/react-start.d.cts +1 -1
  84. package/dist/integrations/react-start.d.mts +1 -1
  85. package/dist/integrations/react-start.d.ts +1 -1
  86. package/dist/integrations/react-start.mjs +4 -4
  87. package/dist/integrations/svelte-kit.cjs +3 -3
  88. package/dist/integrations/svelte-kit.d.cts +1 -1
  89. package/dist/integrations/svelte-kit.d.mts +1 -1
  90. package/dist/integrations/svelte-kit.d.ts +1 -1
  91. package/dist/integrations/svelte-kit.mjs +3 -3
  92. package/dist/oauth2/index.cjs +3 -3
  93. package/dist/oauth2/index.d.cts +2 -2
  94. package/dist/oauth2/index.d.mts +2 -2
  95. package/dist/oauth2/index.d.ts +2 -2
  96. package/dist/oauth2/index.mjs +3 -3
  97. package/dist/plugins/admin/index.cjs +4 -4
  98. package/dist/plugins/admin/index.d.cts +16 -1
  99. package/dist/plugins/admin/index.d.mts +16 -1
  100. package/dist/plugins/admin/index.d.ts +16 -1
  101. package/dist/plugins/admin/index.mjs +4 -4
  102. package/dist/plugins/anonymous/index.cjs +3 -3
  103. package/dist/plugins/anonymous/index.d.cts +1 -1
  104. package/dist/plugins/anonymous/index.d.mts +1 -1
  105. package/dist/plugins/anonymous/index.d.ts +1 -1
  106. package/dist/plugins/anonymous/index.mjs +3 -3
  107. package/dist/plugins/bearer/index.cjs +3 -3
  108. package/dist/plugins/bearer/index.d.cts +1 -1
  109. package/dist/plugins/bearer/index.d.mts +1 -1
  110. package/dist/plugins/bearer/index.d.ts +1 -1
  111. package/dist/plugins/bearer/index.mjs +3 -3
  112. package/dist/plugins/captcha/index.d.cts +1 -1
  113. package/dist/plugins/captcha/index.d.mts +1 -1
  114. package/dist/plugins/captcha/index.d.ts +1 -1
  115. package/dist/plugins/custom-session/index.cjs +7 -9
  116. package/dist/plugins/custom-session/index.d.cts +1 -1
  117. package/dist/plugins/custom-session/index.d.mts +1 -1
  118. package/dist/plugins/custom-session/index.d.ts +1 -1
  119. package/dist/plugins/custom-session/index.mjs +7 -9
  120. package/dist/plugins/device-authorization/index.cjs +18 -50
  121. package/dist/plugins/device-authorization/index.d.cts +1 -1
  122. package/dist/plugins/device-authorization/index.d.mts +1 -1
  123. package/dist/plugins/device-authorization/index.d.ts +1 -1
  124. package/dist/plugins/device-authorization/index.mjs +18 -50
  125. package/dist/plugins/email-otp/index.cjs +20 -60
  126. package/dist/plugins/email-otp/index.d.cts +1 -1
  127. package/dist/plugins/email-otp/index.d.mts +1 -1
  128. package/dist/plugins/email-otp/index.d.ts +1 -1
  129. package/dist/plugins/email-otp/index.mjs +20 -60
  130. package/dist/plugins/generic-oauth/index.cjs +24 -42
  131. package/dist/plugins/generic-oauth/index.d.cts +1 -1
  132. package/dist/plugins/generic-oauth/index.d.mts +1 -1
  133. package/dist/plugins/generic-oauth/index.d.ts +1 -1
  134. package/dist/plugins/generic-oauth/index.mjs +24 -42
  135. package/dist/plugins/haveibeenpwned/index.cjs +3 -3
  136. package/dist/plugins/haveibeenpwned/index.d.cts +1 -1
  137. package/dist/plugins/haveibeenpwned/index.d.mts +1 -1
  138. package/dist/plugins/haveibeenpwned/index.d.ts +1 -1
  139. package/dist/plugins/haveibeenpwned/index.mjs +3 -3
  140. package/dist/plugins/index.cjs +10 -9
  141. package/dist/plugins/index.d.cts +3 -3
  142. package/dist/plugins/index.d.mts +3 -3
  143. package/dist/plugins/index.d.ts +3 -3
  144. package/dist/plugins/index.mjs +12 -11
  145. package/dist/plugins/jwt/index.cjs +3 -3
  146. package/dist/plugins/jwt/index.d.cts +1 -1
  147. package/dist/plugins/jwt/index.d.mts +1 -1
  148. package/dist/plugins/jwt/index.d.ts +1 -1
  149. package/dist/plugins/jwt/index.mjs +3 -3
  150. package/dist/plugins/magic-link/index.cjs +20 -30
  151. package/dist/plugins/magic-link/index.mjs +20 -30
  152. package/dist/plugins/multi-session/index.cjs +5 -9
  153. package/dist/plugins/multi-session/index.d.cts +1 -1
  154. package/dist/plugins/multi-session/index.d.mts +1 -1
  155. package/dist/plugins/multi-session/index.d.ts +1 -1
  156. package/dist/plugins/multi-session/index.mjs +5 -9
  157. package/dist/plugins/oauth-proxy/index.cjs +8 -10
  158. package/dist/plugins/oauth-proxy/index.d.cts +2 -1
  159. package/dist/plugins/oauth-proxy/index.d.mts +2 -1
  160. package/dist/plugins/oauth-proxy/index.d.ts +2 -1
  161. package/dist/plugins/oauth-proxy/index.mjs +8 -10
  162. package/dist/plugins/oidc-provider/index.cjs +4 -4
  163. package/dist/plugins/oidc-provider/index.d.cts +9 -9
  164. package/dist/plugins/oidc-provider/index.d.mts +9 -9
  165. package/dist/plugins/oidc-provider/index.d.ts +9 -9
  166. package/dist/plugins/oidc-provider/index.mjs +4 -4
  167. package/dist/plugins/one-tap/index.cjs +6 -6
  168. package/dist/plugins/one-tap/index.mjs +6 -6
  169. package/dist/plugins/one-time-token/index.cjs +6 -6
  170. package/dist/plugins/one-time-token/index.d.cts +1 -1
  171. package/dist/plugins/one-time-token/index.d.mts +1 -1
  172. package/dist/plugins/one-time-token/index.d.ts +1 -1
  173. package/dist/plugins/one-time-token/index.mjs +6 -6
  174. package/dist/plugins/open-api/index.cjs +3 -3
  175. package/dist/plugins/open-api/index.d.cts +1 -1
  176. package/dist/plugins/open-api/index.d.mts +1 -1
  177. package/dist/plugins/open-api/index.d.ts +1 -1
  178. package/dist/plugins/open-api/index.mjs +3 -3
  179. package/dist/plugins/organization/access/index.d.cts +25 -25
  180. package/dist/plugins/organization/access/index.d.mts +25 -25
  181. package/dist/plugins/organization/access/index.d.ts +25 -25
  182. package/dist/plugins/organization/index.cjs +6 -6
  183. package/dist/plugins/organization/index.d.cts +77 -13
  184. package/dist/plugins/organization/index.d.mts +77 -13
  185. package/dist/plugins/organization/index.d.ts +77 -13
  186. package/dist/plugins/organization/index.mjs +6 -6
  187. package/dist/plugins/passkey/index.cjs +14 -18
  188. package/dist/plugins/passkey/index.d.cts +2 -2
  189. package/dist/plugins/passkey/index.d.mts +2 -2
  190. package/dist/plugins/passkey/index.d.ts +2 -2
  191. package/dist/plugins/passkey/index.mjs +14 -18
  192. package/dist/plugins/phone-number/index.cjs +23 -39
  193. package/dist/plugins/phone-number/index.d.cts +1 -1
  194. package/dist/plugins/phone-number/index.d.mts +1 -1
  195. package/dist/plugins/phone-number/index.d.ts +1 -1
  196. package/dist/plugins/phone-number/index.mjs +23 -39
  197. package/dist/plugins/siwe/index.cjs +3 -3
  198. package/dist/plugins/siwe/index.d.cts +1 -1
  199. package/dist/plugins/siwe/index.d.mts +1 -1
  200. package/dist/plugins/siwe/index.d.ts +1 -1
  201. package/dist/plugins/siwe/index.mjs +3 -3
  202. package/dist/plugins/sso/index.cjs +61 -87
  203. package/dist/plugins/sso/index.d.cts +3 -3
  204. package/dist/plugins/sso/index.d.mts +3 -3
  205. package/dist/plugins/sso/index.d.ts +3 -3
  206. package/dist/plugins/sso/index.mjs +61 -87
  207. package/dist/plugins/two-factor/index.cjs +18 -48
  208. package/dist/plugins/two-factor/index.d.cts +1 -1
  209. package/dist/plugins/two-factor/index.d.mts +1 -1
  210. package/dist/plugins/two-factor/index.d.ts +1 -1
  211. package/dist/plugins/two-factor/index.mjs +18 -48
  212. package/dist/plugins/username/index.cjs +31 -16
  213. package/dist/plugins/username/index.d.cts +3 -3
  214. package/dist/plugins/username/index.d.mts +3 -3
  215. package/dist/plugins/username/index.d.ts +3 -3
  216. package/dist/plugins/username/index.mjs +31 -16
  217. package/dist/shared/{better-auth.DNMTw_ds.d.ts → better-auth.6RZwqXI-.d.ts} +1 -1
  218. package/dist/shared/{better-auth.Btbv22jM.mjs → better-auth.7DsuGNVf.mjs} +5 -3
  219. package/dist/shared/{better-auth.C1AWk7z7.mjs → better-auth.AYS43XM1.mjs} +1 -1
  220. package/dist/shared/{better-auth.g33XFa_C.mjs → better-auth.B-3-wkBV.mjs} +167 -262
  221. package/dist/shared/{better-auth.BkcRiga0.cjs → better-auth.B-RhOtHf.cjs} +1 -1
  222. package/dist/shared/{better-auth.DTgTiHPJ.d.ts → better-auth.B1CNK_q_.d.ts} +1 -1
  223. package/dist/shared/{better-auth.BnOSz3eR.mjs → better-auth.BBFsjzvB.mjs} +2 -2
  224. package/dist/shared/{better-auth.Bhva6lEh.cjs → better-auth.BBk8MRta.cjs} +1 -1
  225. package/dist/shared/{better-auth.BYskLPvJ.d.ts → better-auth.BCHg51sY.d.ts} +1 -1
  226. package/dist/shared/{better-auth.C1Tqa_El.d.cts → better-auth.BTUgO__s.d.mts} +1 -1
  227. package/dist/shared/{better-auth.B5O-5tFi.cjs → better-auth.BclXpYOz.cjs} +5 -3
  228. package/dist/shared/{better-auth.DHi8l3iG.d.mts → better-auth.BeDYIF5-.d.mts} +1 -1
  229. package/dist/shared/{better-auth.yovXNUaS.d.cts → better-auth.BeOpqAwl.d.cts} +1 -1
  230. package/dist/shared/{better-auth.Brg-UO7k.d.ts → better-auth.BsnsCAjn.d.ts} +7 -7
  231. package/dist/shared/{better-auth.fV_ra52g.mjs → better-auth.C3bLnul-.mjs} +1 -1
  232. package/dist/shared/{better-auth.D6pGomIg.cjs → better-auth.C5s1d_o-.cjs} +75 -150
  233. package/dist/shared/{better-auth.C29_dxUJ.cjs → better-auth.CL5zQvRZ.cjs} +167 -262
  234. package/dist/shared/{better-auth.C0-0BnjK.d.mts → better-auth.CkCyjQ6r.d.mts} +1 -1
  235. package/dist/shared/{better-auth.CBY7cUGy.mjs → better-auth.Co88PbP3.mjs} +6 -10
  236. package/dist/shared/{better-auth.BPua9lvR.mjs → better-auth.D-4EtUes.mjs} +75 -150
  237. package/dist/shared/{better-auth.DXGtScCP.cjs → better-auth.D2444EHu.cjs} +2 -2
  238. package/dist/shared/{better-auth.DTyvXiMc.cjs → better-auth.DCOXb_2e.cjs} +48 -84
  239. package/dist/shared/{better-auth.DRukcsOo.d.mts → better-auth.DDOCnCqi.d.cts} +1 -1
  240. package/dist/shared/{better-auth.B1ufdjSo.mjs → better-auth.DFfA4Mzz.mjs} +5 -5
  241. package/dist/shared/{better-auth.CXM9s0dx.cjs → better-auth.DIfV2UBl.cjs} +1 -1
  242. package/dist/shared/{better-auth.spSlDaxD.cjs → better-auth.DP5SyJ_2.cjs} +68 -117
  243. package/dist/shared/{better-auth.DhsGZ30Q.cjs → better-auth.DUNU0obG.cjs} +1 -1
  244. package/dist/shared/{better-auth.Ddv1-cj-.mjs → better-auth.DUTxy-hg.mjs} +2 -2
  245. package/dist/shared/{better-auth.D07k8aB_.d.cts → better-auth.DY9WffSn.d.cts} +1 -1
  246. package/dist/shared/{better-auth.Bo_XNm3Z.mjs → better-auth.Df_5rmaV.mjs} +24 -48
  247. package/dist/shared/{better-auth.DL8idXrv.mjs → better-auth.DhQzyejE.mjs} +1 -1
  248. package/dist/shared/{better-auth.Gu1qAjVj.d.mts → better-auth.DhRmxPro.d.mts} +7 -7
  249. package/dist/shared/{better-auth.Bb_sp3q4.cjs → better-auth.DnBI2Nus.cjs} +5 -5
  250. package/dist/shared/{better-auth.Dsq5BCiY.mjs → better-auth.DteMRrRX.mjs} +68 -117
  251. package/dist/shared/{better-auth.demy6Fla.cjs → better-auth.DxN8-4Pz.cjs} +24 -48
  252. package/dist/shared/{better-auth.2jEckJ7k.cjs → better-auth.SS_wBML-.cjs} +2 -2
  253. package/dist/shared/{better-auth.3naUdTMW.mjs → better-auth.T3Ux10v9.mjs} +1 -1
  254. package/dist/shared/{better-auth.B1kKIM0o.d.cts → better-auth.U9CXSJA_.d.cts} +7 -7
  255. package/dist/shared/{better-auth.CvVm_hFg.cjs → better-auth.iE8wqp5_.cjs} +1 -1
  256. package/dist/shared/{better-auth.ffWeg50w.mjs → better-auth.msGOU0m9.mjs} +1 -1
  257. package/dist/shared/{better-auth.Cj28z0kQ.mjs → better-auth.vd9ibIsl.mjs} +48 -84
  258. package/dist/shared/{better-auth.CAcHGnwq.cjs → better-auth.wBgaxGEw.cjs} +6 -10
  259. package/dist/social-providers/index.cjs +3 -3
  260. package/dist/social-providers/index.mjs +3 -3
  261. package/dist/test-utils/index.cjs +11 -11
  262. package/dist/test-utils/index.d.cts +12 -12
  263. package/dist/test-utils/index.d.mts +12 -12
  264. package/dist/test-utils/index.d.ts +12 -12
  265. package/dist/test-utils/index.mjs +11 -11
  266. package/dist/types/index.d.cts +2 -2
  267. package/dist/types/index.d.mts +2 -2
  268. package/dist/types/index.d.ts +2 -2
  269. package/package.json +2 -6
@@ -2,15 +2,15 @@
2
2
 
3
3
  const z = require('zod');
4
4
  const betterCall = require('better-call');
5
- const session = require('./better-auth.CAcHGnwq.cjs');
6
- require('./better-auth.D6pGomIg.cjs');
5
+ const session = require('./better-auth.wBgaxGEw.cjs');
6
+ require('./better-auth.C5s1d_o-.cjs');
7
7
  require('./better-auth.B6fIklBU.cjs');
8
8
  const base64 = require('@better-auth/utils/base64');
9
9
  require('@better-auth/utils/hmac');
10
10
  require('./better-auth.DTvRBuq4.cjs');
11
11
  require('@better-auth/utils/binary');
12
12
  const schema = require('./better-auth.C0qxpMUS.cjs');
13
- require('./better-auth.2jEckJ7k.cjs');
13
+ require('./better-auth.SS_wBML-.cjs');
14
14
  require('../plugins/organization/access/index.cjs');
15
15
  require('@better-auth/utils/random');
16
16
  const hash = require('@better-auth/utils/hash');
@@ -29,7 +29,7 @@ require('@better-auth/utils');
29
29
  require('../plugins/custom-session/index.cjs');
30
30
  const date = require('./better-auth.C1hdVENX.cjs');
31
31
  const getRequestIp = require('./better-auth.DkbzbiTb.cjs');
32
- const parser = require('./better-auth.DhsGZ30Q.cjs');
32
+ const parser = require('./better-auth.DUNU0obG.cjs');
33
33
  const json = require('./better-auth.DgMx7bVs.cjs');
34
34
  const plugins_access_index = require('../plugins/access/index.cjs');
35
35
  require('@noble/hashes/sha3.js');
@@ -250,38 +250,30 @@ function createApiKey({
250
250
  {
251
251
  method: "POST",
252
252
  body: z__namespace.object({
253
- name: z__namespace.string().meta({ description: "Name of the Api Key" }).optional(),
254
- expiresIn: z__namespace.number().meta({
255
- description: "Expiration time of the Api Key in seconds"
256
- }).min(1).optional().nullable().default(null),
257
- userId: z__namespace.coerce.string().meta({
258
- description: 'User Id of the user that the Api Key belongs to. server-only. Eg: "user-id"'
259
- }).optional(),
260
- prefix: z__namespace.string().meta({ description: "Prefix of the Api Key" }).regex(/^[a-zA-Z0-9_-]+$/, {
253
+ name: z__namespace.string().describe("Name of the Api Key").optional(),
254
+ expiresIn: z__namespace.number().describe("Expiration time of the Api Key in seconds").min(1).optional().nullable().default(null),
255
+ userId: z__namespace.coerce.string().describe(
256
+ "User Id of the user that the Api Key belongs to. server-only"
257
+ ).optional(),
258
+ prefix: z__namespace.string().describe("Prefix of the Api Key").regex(/^[a-zA-Z0-9_-]+$/, {
261
259
  message: "Invalid prefix format, must be alphanumeric and contain only underscores and hyphens."
262
260
  }).optional(),
263
- remaining: z__namespace.number().meta({
264
- description: "Remaining number of requests. Server side only"
265
- }).min(0).optional().nullable().default(null),
261
+ remaining: z__namespace.number().describe("Remaining number of requests. Server side only").min(0).optional().nullable().default(null),
266
262
  metadata: z__namespace.any().optional(),
267
- refillAmount: z__namespace.number().meta({
268
- description: "Amount to refill the remaining count of the Api Key. server-only. Eg: 100"
269
- }).min(1).optional(),
270
- refillInterval: z__namespace.number().meta({
271
- description: "Interval to refill the Api Key in milliseconds. server-only. Eg: 1000"
272
- }).optional(),
273
- rateLimitTimeWindow: z__namespace.number().meta({
274
- description: "The duration in milliseconds where each request is counted. Once the `maxRequests` is reached, the request will be rejected until the `timeWindow` has passed, at which point the `timeWindow` will be reset. server-only. Eg: 1000"
275
- }).optional(),
276
- rateLimitMax: z__namespace.number().meta({
277
- description: "Maximum amount of requests allowed within a window. Once the `maxRequests` is reached, the request will be rejected until the `timeWindow` has passed, at which point the `timeWindow` will be reset. server-only. Eg: 100"
278
- }).optional(),
279
- rateLimitEnabled: z__namespace.boolean().meta({
280
- description: "Whether the key has rate limiting enabled. server-only. Eg: true"
281
- }).optional(),
282
- permissions: z__namespace.record(z__namespace.string(), z__namespace.array(z__namespace.string())).meta({
283
- description: "Permissions of the Api Key."
284
- }).optional()
263
+ refillAmount: z__namespace.number().describe(
264
+ "Amount to refill the remaining count of the Api Key. server-only"
265
+ ).min(1).optional(),
266
+ refillInterval: z__namespace.number().describe(
267
+ "Interval to refill the Api Key in milliseconds. server-only"
268
+ ).optional(),
269
+ rateLimitTimeWindow: z__namespace.number().describe(
270
+ "The duration in milliseconds where each request is counted. Once the `maxRequests` is reached, the request will be rejected until the `timeWindow` has passed, at which point the `timeWindow` will be reset. server-only"
271
+ ).optional(),
272
+ rateLimitMax: z__namespace.number().describe(
273
+ "Maximum amount of requests allowed within a window. Once the `maxRequests` is reached, the request will be rejected until the `timeWindow` has passed, at which point the `timeWindow` will be reset. server-only"
274
+ ).optional(),
275
+ rateLimitEnabled: z__namespace.boolean().describe("Whether the key has rate limiting enabled. server-only").optional(),
276
+ permissions: z__namespace.record(z__namespace.string(), z__namespace.array(z__namespace.string())).describe("Permissions of the Api Key.").optional()
285
277
  }),
286
278
  metadata: {
287
279
  openapi: {
@@ -581,9 +573,7 @@ function deleteApiKey({
581
573
  {
582
574
  method: "POST",
583
575
  body: z__namespace.object({
584
- keyId: z__namespace.string().meta({
585
- description: "The id of the Api Key"
586
- })
576
+ keyId: z__namespace.string().describe("The id of the Api Key")
587
577
  }),
588
578
  use: [session.sessionMiddleware],
589
579
  metadata: {
@@ -682,9 +672,7 @@ function getApiKey({
682
672
  {
683
673
  method: "GET",
684
674
  query: z__namespace.object({
685
- id: z__namespace.string().meta({
686
- description: "The id of the Api Key"
687
- })
675
+ id: z__namespace.string().describe("The id of the Api Key")
688
676
  }),
689
677
  use: [session.sessionMiddleware],
690
678
  metadata: {
@@ -860,43 +848,25 @@ function updateApiKey({
860
848
  {
861
849
  method: "POST",
862
850
  body: z__namespace.object({
863
- keyId: z__namespace.string().meta({
864
- description: "The id of the Api Key"
865
- }),
866
- userId: z__namespace.coerce.string().meta({
867
- description: 'The id of the user which the api key belongs to. server-only. Eg: "some-user-id"'
868
- }).optional(),
869
- name: z__namespace.string().meta({
870
- description: "The name of the key"
871
- }).optional(),
872
- enabled: z__namespace.boolean().meta({
873
- description: "Whether the Api Key is enabled or not"
874
- }).optional(),
875
- remaining: z__namespace.number().meta({
876
- description: "The number of remaining requests"
877
- }).min(1).optional(),
878
- refillAmount: z__namespace.number().meta({
879
- description: "The refill amount"
880
- }).optional(),
881
- refillInterval: z__namespace.number().meta({
882
- description: "The refill interval"
883
- }).optional(),
851
+ keyId: z__namespace.string().describe("The id of the Api Key"),
852
+ userId: z__namespace.coerce.string().describe(
853
+ "The id of the user which the api key belongs to. server-only. Eg: "
854
+ ).optional(),
855
+ name: z__namespace.string().describe("The name of the key").optional(),
856
+ enabled: z__namespace.boolean().describe("Whether the Api Key is enabled or not").optional(),
857
+ remaining: z__namespace.number().describe("The number of remaining requests").min(1).optional(),
858
+ refillAmount: z__namespace.number().describe("The refill amount").optional(),
859
+ refillInterval: z__namespace.number().describe("The refill interval").optional(),
884
860
  metadata: z__namespace.any().optional(),
885
- expiresIn: z__namespace.number().meta({
886
- description: "Expiration time of the Api Key in seconds"
887
- }).min(1).optional().nullable(),
888
- rateLimitEnabled: z__namespace.boolean().meta({
889
- description: "Whether the key has rate limiting enabled."
890
- }).optional(),
891
- rateLimitTimeWindow: z__namespace.number().meta({
892
- description: "The duration in milliseconds where each request is counted. server-only. Eg: 1000"
893
- }).optional(),
894
- rateLimitMax: z__namespace.number().meta({
895
- description: "Maximum amount of requests allowed within a window. Once the `maxRequests` is reached, the request will be rejected until the `timeWindow` has passed, at which point the `timeWindow` will be reset. server-only. Eg: 100"
896
- }).optional(),
897
- permissions: z__namespace.record(z__namespace.string(), z__namespace.array(z__namespace.string())).meta({
898
- description: "Update the permissions on the API Key. server-only."
899
- }).optional().nullable()
861
+ expiresIn: z__namespace.number().describe("Expiration time of the Api Key in seconds").min(1).optional().nullable(),
862
+ rateLimitEnabled: z__namespace.boolean().describe("Whether the key has rate limiting enabled.").optional(),
863
+ rateLimitTimeWindow: z__namespace.number().describe(
864
+ "The duration in milliseconds where each request is counted. server-only. Eg: 1000"
865
+ ).optional(),
866
+ rateLimitMax: z__namespace.number().describe(
867
+ "Maximum amount of requests allowed within a window. Once the `maxRequests` is reached, the request will be rejected until the `timeWindow` has passed, at which point the `timeWindow` will be reset. server-only. Eg: 100"
868
+ ).optional(),
869
+ permissions: z__namespace.record(z__namespace.string(), z__namespace.array(z__namespace.string())).describe("Update the permissions on the API Key. server-only.").optional().nullable()
900
870
  }),
901
871
  metadata: {
902
872
  openapi: {
@@ -1399,12 +1369,8 @@ function verifyApiKey({
1399
1369
  {
1400
1370
  method: "POST",
1401
1371
  body: z__namespace.object({
1402
- key: z__namespace.string().meta({
1403
- description: "The key to verify"
1404
- }),
1405
- permissions: z__namespace.record(z__namespace.string(), z__namespace.array(z__namespace.string())).meta({
1406
- description: "The permissions to verify."
1407
- }).optional()
1372
+ key: z__namespace.string().describe("The key to verify"),
1373
+ permissions: z__namespace.record(z__namespace.string(), z__namespace.array(z__namespace.string())).describe("The permissions to verify.").optional()
1408
1374
  }),
1409
1375
  metadata: {
1410
1376
  SERVER_ONLY: true
@@ -2102,9 +2068,7 @@ const oneTimeToken = (options) => {
2102
2068
  {
2103
2069
  method: "POST",
2104
2070
  body: z__namespace.object({
2105
- token: z__namespace.string().meta({
2106
- description: 'The token to verify. Eg: "some-token"'
2107
- })
2071
+ token: z__namespace.string().describe("The token to verify. Eg: ")
2108
2072
  })
2109
2073
  },
2110
2074
  async (c) => {
@@ -1,4 +1,4 @@
1
- import { G as GenericEndpointContext } from './better-auth.Gu1qAjVj.mjs';
1
+ import { G as GenericEndpointContext } from './better-auth.U9CXSJA_.cjs';
2
2
 
3
3
  declare function generateState(c: GenericEndpointContext, link?: {
4
4
  email: string;
@@ -1,13 +1,13 @@
1
1
  import { checkEndpointConflicts, getEndpoints, router } from '../api/index.mjs';
2
2
  import { defu } from 'defu';
3
3
  import { hashToBase64, verifyPassword, hashPassword } from '../crypto/index.mjs';
4
- import { a as getAdapter, c as createInternalAdapter, e as getMigrations } from './better-auth.Btbv22jM.mjs';
4
+ import { a as getAdapter, c as createInternalAdapter, e as getMigrations } from './better-auth.7DsuGNVf.mjs';
5
5
  import { g as getAuthTables } from './better-auth.Cjw1GDsh.mjs';
6
6
  import 'zod';
7
7
  import './better-auth.Dlx1jCB2.mjs';
8
- import { g as getCookies, c as createCookieGetter } from './better-auth.fV_ra52g.mjs';
8
+ import { g as getCookies, c as createCookieGetter } from './better-auth.C3bLnul-.mjs';
9
9
  import { a as logger, c as createLogger } from './better-auth.C4g12FAA.mjs';
10
- import { U as socialProviders } from './better-auth.BPua9lvR.mjs';
10
+ import { U as socialProviders } from './better-auth.D-4EtUes.mjs';
11
11
  import { g as generateId } from './better-auth.BUPPRXfK.mjs';
12
12
  import 'better-call';
13
13
  import '@better-auth/utils/hash';
@@ -25,8 +25,8 @@ import '@better-auth/utils/hex';
25
25
  import '@noble/hashes/utils.js';
26
26
  import { betterFetch } from '@better-fetch/fetch';
27
27
  import '@better-auth/utils/random';
28
- import { g as getKyselyDatabaseType } from './better-auth.Ddv1-cj-.mjs';
29
- import { B as BASE_ERROR_CODES } from './better-auth.CBY7cUGy.mjs';
28
+ import { g as getKyselyDatabaseType } from './better-auth.DUTxy-hg.mjs';
29
+ import { B as BASE_ERROR_CODES } from './better-auth.Co88PbP3.mjs';
30
30
 
31
31
  const DEFAULT_SECRET = "better-auth-secret-123456789";
32
32
 
@@ -107,7 +107,7 @@ function parseSetCookieHeader(setCookie) {
107
107
  cookieArray.forEach((cookieString) => {
108
108
  const parts = cookieString.split(";").map((part) => part.trim());
109
109
  const [nameValue, ...attributes] = parts;
110
- const [name, ...valueParts] = nameValue.split("=");
110
+ const [name, ...valueParts] = (nameValue || "").split("=");
111
111
  const value = valueParts.join("=");
112
112
  if (!name || value === void 0) {
113
113
  return;
@@ -2,9 +2,9 @@
2
2
 
3
3
  const z = require('zod');
4
4
  const betterCall = require('better-call');
5
- require('./better-auth.D6pGomIg.cjs');
6
- const session = require('./better-auth.CAcHGnwq.cjs');
7
- const cookies_index = require('./better-auth.CXM9s0dx.cjs');
5
+ require('./better-auth.C5s1d_o-.cjs');
6
+ const session = require('./better-auth.wBgaxGEw.cjs');
7
+ const cookies_index = require('./better-auth.DIfV2UBl.cjs');
8
8
  const schema$1 = require('./better-auth.C0qxpMUS.cjs');
9
9
  require('./better-auth.B6fIklBU.cjs');
10
10
  require('./better-auth.DTvRBuq4.cjs');
@@ -198,21 +198,15 @@ const admin = (options) => {
198
198
  {
199
199
  method: "POST",
200
200
  body: z__namespace.object({
201
- userId: z__namespace.coerce.string().meta({
202
- description: "The user id"
203
- }),
201
+ userId: z__namespace.coerce.string().describe("The user id"),
204
202
  role: z__namespace.union([
205
- z__namespace.string().meta({
206
- description: "The role to set. `admin` or `user` by default"
207
- }),
203
+ z__namespace.string().describe("The role to set. `admin` or `user` by default"),
208
204
  z__namespace.array(
209
- z__namespace.string().meta({
210
- description: "The roles to set. `admin` or `user` by default"
211
- })
205
+ z__namespace.string().describe("The roles to set. `admin` or `user` by default")
212
206
  )
213
- ]).meta({
214
- description: "The role to set, this can be a string or an array of strings. Eg: `admin` or `[admin, user]`"
215
- })
207
+ ]).describe(
208
+ "The role to set, this can be a string or an array of strings. Eg: `admin` or `[admin, user]`"
209
+ )
216
210
  }),
217
211
  requireHeaders: true,
218
212
  use: [adminMiddleware],
@@ -275,9 +269,7 @@ const admin = (options) => {
275
269
  {
276
270
  method: "GET",
277
271
  query: z__namespace.object({
278
- id: z__namespace.string().meta({
279
- description: "The id of the User"
280
- })
272
+ id: z__namespace.string().describe("The id of the User")
281
273
  }),
282
274
  use: [adminMiddleware],
283
275
  metadata: {
@@ -350,33 +342,21 @@ const admin = (options) => {
350
342
  {
351
343
  method: "POST",
352
344
  body: z__namespace.object({
353
- email: z__namespace.string().meta({
354
- description: "The email of the user"
355
- }),
356
- password: z__namespace.string().meta({
357
- description: "The password of the user"
358
- }),
359
- name: z__namespace.string().meta({
360
- description: "The name of the user"
361
- }),
345
+ email: z__namespace.string().describe("The email of the user"),
346
+ password: z__namespace.string().describe("The password of the user"),
347
+ name: z__namespace.string().describe("The name of the user"),
362
348
  role: z__namespace.union([
363
- z__namespace.string().meta({
364
- description: "The role of the user"
365
- }),
366
- z__namespace.array(
367
- z__namespace.string().meta({
368
- description: "The roles of user"
369
- })
370
- )
371
- ]).optional().meta({
372
- description: `A string or array of strings representing the roles to apply to the new user. Eg: "user"`
373
- }),
349
+ z__namespace.string().describe("The role of the user"),
350
+ z__namespace.array(z__namespace.string().describe("The roles of user"))
351
+ ]).optional().describe(
352
+ `A string or array of strings representing the roles to apply to the new user. Eg: "user"`
353
+ ),
374
354
  /**
375
355
  * extra fields for user
376
356
  */
377
- data: z__namespace.record(z__namespace.string(), z__namespace.any()).optional().meta({
378
- description: "Extra fields for the user. Including custom additional fields."
379
- })
357
+ data: z__namespace.record(z__namespace.string(), z__namespace.any()).optional().describe(
358
+ "Extra fields for the user. Including custom additional fields."
359
+ )
380
360
  }),
381
361
  metadata: {
382
362
  openapi: {
@@ -465,17 +445,28 @@ const admin = (options) => {
465
445
  });
466
446
  }
467
447
  ),
448
+ /**
449
+ * ### Endpoint
450
+ *
451
+ * POST `/admin/update-user`
452
+ *
453
+ * ### API Methods
454
+ *
455
+ * **server:**
456
+ * `auth.api.adminUpdateUser`
457
+ *
458
+ * **client:**
459
+ * `authClient.admin.updateUser`
460
+ *
461
+ * @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/admin#api-method-admin-update-user)
462
+ */
468
463
  adminUpdateUser: session.createAuthEndpoint(
469
464
  "/admin/update-user",
470
465
  {
471
466
  method: "POST",
472
467
  body: z__namespace.object({
473
- userId: z__namespace.coerce.string().meta({
474
- description: "The user id"
475
- }),
476
- data: z__namespace.record(z__namespace.any(), z__namespace.any()).meta({
477
- description: "The user data to update"
478
- })
468
+ userId: z__namespace.coerce.string().describe("The user id"),
469
+ data: z__namespace.record(z__namespace.any(), z__namespace.any()).describe("The user data to update")
479
470
  }),
480
471
  use: [adminMiddleware],
481
472
  metadata: {
@@ -540,36 +531,20 @@ const admin = (options) => {
540
531
  method: "GET",
541
532
  use: [adminMiddleware],
542
533
  query: z__namespace.object({
543
- searchValue: z__namespace.string().optional().meta({
544
- description: 'The value to search for. Eg: "some name"'
545
- }),
546
- searchField: z__namespace.enum(["email", "name"]).meta({
547
- description: 'The field to search in, defaults to email. Can be `email` or `name`. Eg: "name"'
548
- }).optional(),
549
- searchOperator: z__namespace.enum(["contains", "starts_with", "ends_with"]).meta({
550
- description: 'The operator to use for the search. Can be `contains`, `starts_with` or `ends_with`. Eg: "contains"'
551
- }).optional(),
552
- limit: z__namespace.string().meta({
553
- description: "The number of users to return"
554
- }).or(z__namespace.number()).optional(),
555
- offset: z__namespace.string().meta({
556
- description: "The offset to start from"
557
- }).or(z__namespace.number()).optional(),
558
- sortBy: z__namespace.string().meta({
559
- description: "The field to sort by"
560
- }).optional(),
561
- sortDirection: z__namespace.enum(["asc", "desc"]).meta({
562
- description: "The direction to sort by"
563
- }).optional(),
564
- filterField: z__namespace.string().meta({
565
- description: "The field to filter by"
566
- }).optional(),
567
- filterValue: z__namespace.string().meta({
568
- description: "The value to filter by"
569
- }).or(z__namespace.number()).or(z__namespace.boolean()).optional(),
570
- filterOperator: z__namespace.enum(["eq", "ne", "lt", "lte", "gt", "gte", "contains"]).meta({
571
- description: "The operator to use for the filter"
572
- }).optional()
534
+ searchValue: z__namespace.string().optional().describe('The value to search for. Eg: "some name"'),
535
+ searchField: z__namespace.enum(["email", "name"]).describe(
536
+ 'The field to search in, defaults to email. Can be `email` or `name`. Eg: "name"'
537
+ ).optional(),
538
+ searchOperator: z__namespace.enum(["contains", "starts_with", "ends_with"]).describe(
539
+ 'The operator to use for the search. Can be `contains`, `starts_with` or `ends_with`. Eg: "contains"'
540
+ ).optional(),
541
+ limit: z__namespace.string().describe("The number of users to return").or(z__namespace.number()).optional(),
542
+ offset: z__namespace.string().describe("The offset to start from").or(z__namespace.number()).optional(),
543
+ sortBy: z__namespace.string().describe("The field to sort by").optional(),
544
+ sortDirection: z__namespace.enum(["asc", "desc"]).describe("The direction to sort by").optional(),
545
+ filterField: z__namespace.string().describe("The field to filter by").optional(),
546
+ filterValue: z__namespace.string().describe("The value to filter by").or(z__namespace.number()).or(z__namespace.boolean()).optional(),
547
+ filterOperator: z__namespace.enum(["eq", "ne", "lt", "lte", "gt", "gte", "contains"]).describe("The operator to use for the filter").optional()
573
548
  }),
574
549
  metadata: {
575
550
  openapi: {
@@ -687,9 +662,7 @@ const admin = (options) => {
687
662
  method: "POST",
688
663
  use: [adminMiddleware],
689
664
  body: z__namespace.object({
690
- userId: z__namespace.coerce.string().meta({
691
- description: "The user id"
692
- })
665
+ userId: z__namespace.coerce.string().describe("The user id")
693
666
  }),
694
667
  metadata: {
695
668
  openapi: {
@@ -760,9 +733,7 @@ const admin = (options) => {
760
733
  {
761
734
  method: "POST",
762
735
  body: z__namespace.object({
763
- userId: z__namespace.coerce.string().meta({
764
- description: "The user id"
765
- })
736
+ userId: z__namespace.coerce.string().describe("The user id")
766
737
  }),
767
738
  use: [adminMiddleware],
768
739
  metadata: {
@@ -839,21 +810,15 @@ const admin = (options) => {
839
810
  {
840
811
  method: "POST",
841
812
  body: z__namespace.object({
842
- userId: z__namespace.coerce.string().meta({
843
- description: "The user id"
844
- }),
813
+ userId: z__namespace.coerce.string().describe("The user id"),
845
814
  /**
846
815
  * Reason for the ban
847
816
  */
848
- banReason: z__namespace.string().meta({
849
- description: "The reason for the ban"
850
- }).optional(),
817
+ banReason: z__namespace.string().describe("The reason for the ban").optional(),
851
818
  /**
852
819
  * Number of seconds until the ban expires
853
820
  */
854
- banExpiresIn: z__namespace.number().meta({
855
- description: "The number of seconds until the ban expires"
856
- }).optional()
821
+ banExpiresIn: z__namespace.number().describe("The number of seconds until the ban expires").optional()
857
822
  }),
858
823
  use: [adminMiddleware],
859
824
  metadata: {
@@ -945,9 +910,7 @@ const admin = (options) => {
945
910
  {
946
911
  method: "POST",
947
912
  body: z__namespace.object({
948
- userId: z__namespace.coerce.string().meta({
949
- description: "The user id"
950
- })
913
+ userId: z__namespace.coerce.string().describe("The user id")
951
914
  }),
952
915
  use: [adminMiddleware],
953
916
  metadata: {
@@ -1093,7 +1056,9 @@ const admin = (options) => {
1093
1056
  });
1094
1057
  }
1095
1058
  const [adminSessionToken, dontRememberMeCookie] = adminCookie?.split(":");
1096
- const adminSession = await ctx.context.internalAdapter.findSession(adminSessionToken);
1059
+ const adminSession = await ctx.context.internalAdapter.findSession(
1060
+ adminSessionToken
1061
+ );
1097
1062
  if (!adminSession || adminSession.session.userId !== user.id) {
1098
1063
  throw new betterCall.APIError("INTERNAL_SERVER_ERROR", {
1099
1064
  message: "Failed to find admin session"
@@ -1126,9 +1091,7 @@ const admin = (options) => {
1126
1091
  {
1127
1092
  method: "POST",
1128
1093
  body: z__namespace.object({
1129
- sessionToken: z__namespace.string().meta({
1130
- description: "The session token"
1131
- })
1094
+ sessionToken: z__namespace.string().describe("The session token")
1132
1095
  }),
1133
1096
  use: [adminMiddleware],
1134
1097
  metadata: {
@@ -1199,9 +1162,7 @@ const admin = (options) => {
1199
1162
  {
1200
1163
  method: "POST",
1201
1164
  body: z__namespace.object({
1202
- userId: z__namespace.coerce.string().meta({
1203
- description: "The user id"
1204
- })
1165
+ userId: z__namespace.coerce.string().describe("The user id")
1205
1166
  }),
1206
1167
  use: [adminMiddleware],
1207
1168
  metadata: {
@@ -1270,9 +1231,7 @@ const admin = (options) => {
1270
1231
  {
1271
1232
  method: "POST",
1272
1233
  body: z__namespace.object({
1273
- userId: z__namespace.coerce.string().meta({
1274
- description: "The user id"
1275
- })
1234
+ userId: z__namespace.coerce.string().describe("The user id")
1276
1235
  }),
1277
1236
  use: [adminMiddleware],
1278
1237
  metadata: {
@@ -1354,12 +1313,8 @@ const admin = (options) => {
1354
1313
  {
1355
1314
  method: "POST",
1356
1315
  body: z__namespace.object({
1357
- newPassword: z__namespace.string().meta({
1358
- description: "The new password"
1359
- }),
1360
- userId: z__namespace.coerce.string().meta({
1361
- description: "The user id"
1362
- })
1316
+ newPassword: z__namespace.string().describe("The new password"),
1317
+ userId: z__namespace.coerce.string().describe("The user id")
1363
1318
  }),
1364
1319
  use: [adminMiddleware],
1365
1320
  metadata: {
@@ -1433,12 +1388,8 @@ const admin = (options) => {
1433
1388
  {
1434
1389
  method: "POST",
1435
1390
  body: z__namespace.object({
1436
- userId: z__namespace.coerce.string().optional().meta({
1437
- description: `The user id. Eg: "user-id"`
1438
- }),
1439
- role: z__namespace.string().optional().meta({
1440
- description: `The role to check permission for. Eg: "admin"`
1441
- })
1391
+ userId: z__namespace.coerce.string().optional().describe(`The user id. Eg: "user-id"`),
1392
+ role: z__namespace.string().optional().describe(`The role to check permission for. Eg: "admin"`)
1442
1393
  }).and(
1443
1394
  z__namespace.union([
1444
1395
  z__namespace.object({
@@ -64,7 +64,7 @@ function betterJSONParse(value, options = {}) {
64
64
  return value;
65
65
  }
66
66
  const trimmed = value.trim();
67
- if (trimmed[0] === '"' && trimmed.endsWith('"') && !trimmed.slice(1, -1).includes('"')) {
67
+ if (trimmed.length > 0 && trimmed[0] === '"' && trimmed.endsWith('"') && !trimmed.slice(1, -1).includes('"')) {
68
68
  return trimmed.slice(1, -1);
69
69
  }
70
70
  const lowerValue = trimmed.toLowerCase();
@@ -135,12 +135,12 @@ const kyselyAdapter = (db, config) => {
135
135
  let res;
136
136
  if (config?.type === "mysql") {
137
137
  await builder.execute();
138
- const field = values.id ? "id" : where.length > 0 && where[0].field ? where[0].field : "id";
138
+ const field = values.id ? "id" : where.length > 0 && where[0]?.field ? where[0].field : "id";
139
139
  if (!values.id && where.length === 0) {
140
140
  res = await db2.selectFrom(model).selectAll().orderBy(getFieldName({ model, field }), "desc").limit(1).executeTakeFirst();
141
141
  return res;
142
142
  }
143
- const value = values[field] || where[0].value;
143
+ const value = values[field] || where[0]?.value;
144
144
  res = await db2.selectFrom(model).selectAll().orderBy(getFieldName({ model, field }), "desc").where(getFieldName({ model, field }), "=", value).limit(1).executeTakeFirst();
145
145
  return res;
146
146
  }
@@ -1,4 +1,4 @@
1
- import { n as BetterAuthPlugin, B as BetterAuthOptions, ah as InferFieldsInputClient, af as InferFieldsOutput, U as User, S as Session, c as Auth } from './better-auth.B1kKIM0o.cjs';
1
+ import { n as BetterAuthPlugin, B as BetterAuthOptions, ah as InferFieldsInputClient, af as InferFieldsOutput, U as User, S as Session, c as Auth } from './better-auth.U9CXSJA_.cjs';
2
2
  import { BetterFetchOption, BetterFetchResponse, BetterFetch, BetterFetchPlugin } from '@better-fetch/fetch';
3
3
  import { WritableAtom, Atom } from 'nanostores';
4
4
  import { U as UnionToIntersection, H as HasRequiredKeys, a as Prettify, L as LiteralString, S as StripEmptyObjects } from './better-auth.DTtXpZYr.cjs';