better-auth 1.2.4-beta.9 → 1.2.5-beta.1

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 (210) hide show
  1. package/dist/adapters/drizzle-adapter/index.d.cts +2 -2
  2. package/dist/adapters/drizzle-adapter/index.d.mts +2 -2
  3. package/dist/adapters/drizzle-adapter/index.d.ts +2 -2
  4. package/dist/adapters/kysely-adapter/index.d.cts +2 -2
  5. package/dist/adapters/kysely-adapter/index.d.mts +2 -2
  6. package/dist/adapters/kysely-adapter/index.d.ts +2 -2
  7. package/dist/adapters/memory-adapter/index.d.cts +2 -2
  8. package/dist/adapters/memory-adapter/index.d.mts +2 -2
  9. package/dist/adapters/memory-adapter/index.d.ts +2 -2
  10. package/dist/adapters/mongodb-adapter/index.d.cts +2 -2
  11. package/dist/adapters/mongodb-adapter/index.d.mts +2 -2
  12. package/dist/adapters/mongodb-adapter/index.d.ts +2 -2
  13. package/dist/adapters/prisma-adapter/index.d.cts +2 -2
  14. package/dist/adapters/prisma-adapter/index.d.mts +2 -2
  15. package/dist/adapters/prisma-adapter/index.d.ts +2 -2
  16. package/dist/adapters/test.d.cts +2 -2
  17. package/dist/adapters/test.d.mts +2 -2
  18. package/dist/adapters/test.d.ts +2 -2
  19. package/dist/api/index.cjs +2 -2
  20. package/dist/api/index.d.cts +2 -2
  21. package/dist/api/index.d.mts +2 -2
  22. package/dist/api/index.d.ts +2 -2
  23. package/dist/api/index.mjs +3 -3
  24. package/dist/client/index.cjs +2 -2
  25. package/dist/client/index.d.cts +2 -2
  26. package/dist/client/index.d.mts +2 -2
  27. package/dist/client/index.d.ts +2 -2
  28. package/dist/client/index.mjs +2 -2
  29. package/dist/client/plugins/index.d.cts +6 -26
  30. package/dist/client/plugins/index.d.mts +6 -26
  31. package/dist/client/plugins/index.d.ts +6 -26
  32. package/dist/client/react/index.cjs +2 -2
  33. package/dist/client/react/index.d.cts +2 -2
  34. package/dist/client/react/index.d.mts +2 -2
  35. package/dist/client/react/index.d.ts +2 -2
  36. package/dist/client/react/index.mjs +2 -2
  37. package/dist/client/solid/index.cjs +2 -2
  38. package/dist/client/solid/index.d.cts +3 -2
  39. package/dist/client/solid/index.d.mts +3 -2
  40. package/dist/client/solid/index.d.ts +3 -2
  41. package/dist/client/solid/index.mjs +2 -2
  42. package/dist/client/svelte/index.cjs +2 -2
  43. package/dist/client/svelte/index.d.cts +3 -2
  44. package/dist/client/svelte/index.d.mts +3 -2
  45. package/dist/client/svelte/index.d.ts +3 -2
  46. package/dist/client/svelte/index.mjs +2 -2
  47. package/dist/client/vue/index.cjs +2 -2
  48. package/dist/client/vue/index.d.cts +3 -2
  49. package/dist/client/vue/index.d.mts +3 -2
  50. package/dist/client/vue/index.d.ts +3 -2
  51. package/dist/client/vue/index.mjs +2 -2
  52. package/dist/cookies/index.cjs +6 -2
  53. package/dist/cookies/index.d.cts +2 -2
  54. package/dist/cookies/index.d.mts +2 -2
  55. package/dist/cookies/index.d.ts +2 -2
  56. package/dist/cookies/index.mjs +6 -2
  57. package/dist/crypto/index.d.cts +1 -1
  58. package/dist/crypto/index.d.mts +1 -1
  59. package/dist/crypto/index.d.ts +1 -1
  60. package/dist/db/index.d.cts +3 -3
  61. package/dist/db/index.d.mts +3 -3
  62. package/dist/db/index.d.ts +3 -3
  63. package/dist/index.cjs +13 -9
  64. package/dist/index.d.cts +3 -3
  65. package/dist/index.d.mts +3 -3
  66. package/dist/index.d.ts +3 -3
  67. package/dist/index.mjs +14 -10
  68. package/dist/integrations/next-js.cjs +4 -4
  69. package/dist/integrations/next-js.d.cts +2 -2
  70. package/dist/integrations/next-js.d.mts +2 -2
  71. package/dist/integrations/next-js.d.ts +2 -2
  72. package/dist/integrations/next-js.mjs +4 -4
  73. package/dist/integrations/node.d.cts +2 -2
  74. package/dist/integrations/node.d.mts +2 -2
  75. package/dist/integrations/node.d.ts +2 -2
  76. package/dist/integrations/svelte-kit.d.cts +2 -2
  77. package/dist/integrations/svelte-kit.d.mts +2 -2
  78. package/dist/integrations/svelte-kit.d.ts +2 -2
  79. package/dist/oauth2/index.d.cts +4 -4
  80. package/dist/oauth2/index.d.mts +4 -4
  81. package/dist/oauth2/index.d.ts +4 -4
  82. package/dist/plugins/admin/index.cjs +3 -3
  83. package/dist/plugins/admin/index.d.cts +10 -3
  84. package/dist/plugins/admin/index.d.mts +10 -3
  85. package/dist/plugins/admin/index.d.ts +10 -3
  86. package/dist/plugins/admin/index.mjs +3 -3
  87. package/dist/plugins/anonymous/index.cjs +2 -2
  88. package/dist/plugins/anonymous/index.d.cts +2 -2
  89. package/dist/plugins/anonymous/index.d.mts +2 -2
  90. package/dist/plugins/anonymous/index.d.ts +2 -2
  91. package/dist/plugins/anonymous/index.mjs +2 -2
  92. package/dist/plugins/bearer/index.cjs +2 -2
  93. package/dist/plugins/bearer/index.d.cts +2 -2
  94. package/dist/plugins/bearer/index.d.mts +2 -2
  95. package/dist/plugins/bearer/index.d.ts +2 -2
  96. package/dist/plugins/bearer/index.mjs +2 -2
  97. package/dist/plugins/custom-session/index.cjs +2 -2
  98. package/dist/plugins/custom-session/index.d.cts +2 -2
  99. package/dist/plugins/custom-session/index.d.mts +2 -2
  100. package/dist/plugins/custom-session/index.d.ts +2 -2
  101. package/dist/plugins/custom-session/index.mjs +2 -2
  102. package/dist/plugins/email-otp/index.cjs +2 -2
  103. package/dist/plugins/email-otp/index.d.cts +2 -2
  104. package/dist/plugins/email-otp/index.d.mts +2 -2
  105. package/dist/plugins/email-otp/index.d.ts +2 -2
  106. package/dist/plugins/email-otp/index.mjs +2 -2
  107. package/dist/plugins/generic-oauth/index.cjs +6 -4
  108. package/dist/plugins/generic-oauth/index.d.cts +7 -2
  109. package/dist/plugins/generic-oauth/index.d.mts +7 -2
  110. package/dist/plugins/generic-oauth/index.d.ts +7 -2
  111. package/dist/plugins/generic-oauth/index.mjs +6 -4
  112. package/dist/plugins/index.cjs +7 -7
  113. package/dist/plugins/index.d.cts +4 -4
  114. package/dist/plugins/index.d.mts +4 -4
  115. package/dist/plugins/index.d.ts +4 -4
  116. package/dist/plugins/index.mjs +7 -8
  117. package/dist/plugins/jwt/index.cjs +2 -2
  118. package/dist/plugins/jwt/index.d.cts +2 -2
  119. package/dist/plugins/jwt/index.d.mts +2 -2
  120. package/dist/plugins/jwt/index.d.ts +2 -2
  121. package/dist/plugins/jwt/index.mjs +2 -2
  122. package/dist/plugins/magic-link/index.cjs +2 -2
  123. package/dist/plugins/magic-link/index.mjs +2 -2
  124. package/dist/plugins/multi-session/index.cjs +2 -2
  125. package/dist/plugins/multi-session/index.d.cts +2 -2
  126. package/dist/plugins/multi-session/index.d.mts +2 -2
  127. package/dist/plugins/multi-session/index.d.ts +2 -2
  128. package/dist/plugins/multi-session/index.mjs +2 -2
  129. package/dist/plugins/oauth-proxy/index.cjs +2 -2
  130. package/dist/plugins/oauth-proxy/index.d.cts +2 -2
  131. package/dist/plugins/oauth-proxy/index.d.mts +2 -2
  132. package/dist/plugins/oauth-proxy/index.d.ts +2 -2
  133. package/dist/plugins/oauth-proxy/index.mjs +2 -2
  134. package/dist/plugins/oidc-provider/index.cjs +2 -2
  135. package/dist/plugins/oidc-provider/index.mjs +2 -2
  136. package/dist/plugins/one-tap/index.cjs +2 -2
  137. package/dist/plugins/one-tap/index.mjs +2 -2
  138. package/dist/plugins/open-api/index.cjs +2 -2
  139. package/dist/plugins/open-api/index.d.cts +2 -2
  140. package/dist/plugins/open-api/index.d.mts +2 -2
  141. package/dist/plugins/open-api/index.d.ts +2 -2
  142. package/dist/plugins/open-api/index.mjs +2 -2
  143. package/dist/plugins/organization/index.cjs +4 -4
  144. package/dist/plugins/organization/index.d.cts +3 -3
  145. package/dist/plugins/organization/index.d.mts +3 -3
  146. package/dist/plugins/organization/index.d.ts +3 -3
  147. package/dist/plugins/organization/index.mjs +3 -4
  148. package/dist/plugins/passkey/index.cjs +2 -2
  149. package/dist/plugins/passkey/index.d.cts +2 -2
  150. package/dist/plugins/passkey/index.d.mts +2 -2
  151. package/dist/plugins/passkey/index.d.ts +2 -2
  152. package/dist/plugins/passkey/index.mjs +2 -2
  153. package/dist/plugins/phone-number/index.cjs +3 -10
  154. package/dist/plugins/phone-number/index.d.cts +4 -4
  155. package/dist/plugins/phone-number/index.d.mts +4 -4
  156. package/dist/plugins/phone-number/index.d.ts +4 -4
  157. package/dist/plugins/phone-number/index.mjs +3 -10
  158. package/dist/plugins/sso/index.cjs +2 -2
  159. package/dist/plugins/sso/index.d.cts +2 -2
  160. package/dist/plugins/sso/index.d.mts +2 -2
  161. package/dist/plugins/sso/index.d.ts +2 -2
  162. package/dist/plugins/sso/index.mjs +2 -2
  163. package/dist/plugins/two-factor/index.cjs +4 -4
  164. package/dist/plugins/two-factor/index.d.cts +2 -2
  165. package/dist/plugins/two-factor/index.d.mts +2 -2
  166. package/dist/plugins/two-factor/index.d.ts +2 -2
  167. package/dist/plugins/two-factor/index.mjs +4 -4
  168. package/dist/plugins/username/index.cjs +2 -2
  169. package/dist/plugins/username/index.d.cts +2 -2
  170. package/dist/plugins/username/index.d.mts +2 -2
  171. package/dist/plugins/username/index.d.ts +2 -2
  172. package/dist/plugins/username/index.mjs +2 -2
  173. package/dist/shared/{better-auth.BRpbZ8Wm.d.ts → better-auth.2gyOPXIw.d.ts} +105 -56
  174. package/dist/shared/{better-auth.GFrhA2ZN.d.cts → better-auth.B36e4YUo.d.cts} +105 -56
  175. package/dist/shared/{better-auth.BO8ywGjx.d.cts → better-auth.BAHeu7c0.d.cts} +1 -1
  176. package/dist/shared/{better-auth.BY1VWBQw.d.mts → better-auth.BChhyjyz.d.mts} +1 -1
  177. package/dist/shared/{better-auth.528z_3BN.mjs → better-auth.BH-DEtIS.mjs} +1 -1
  178. package/dist/shared/{better-auth.DNb3Aogp.cjs → better-auth.BN2jUYPL.cjs} +1 -1
  179. package/dist/shared/{better-auth.BvdK2HVj.cjs → better-auth.Bwt75GhP.cjs} +57 -57
  180. package/dist/shared/{better-auth.DhfiEsxl.cjs → better-auth.C-R0J0n1.cjs} +15 -1
  181. package/dist/shared/{better-auth.CsRXU29y.mjs → better-auth.C1nJLdAt.mjs} +9 -4
  182. package/dist/shared/{better-auth.wVHSijfs.mjs → better-auth.C3yF81jt.mjs} +432 -37
  183. package/dist/shared/{better-auth.Dzvtygs8.d.mts → better-auth.C7bUpbPE.d.mts} +105 -56
  184. package/dist/shared/{better-auth.CPDTS_sd.d.cts → better-auth.CDKE1pWJ.d.cts} +4153 -2358
  185. package/dist/shared/{better-auth.bD8t9wby.cjs → better-auth.CH2vR08q.cjs} +433 -61
  186. package/dist/shared/{better-auth.A0dcaQJJ.d.mts → better-auth.CIlYLU40.d.mts} +1 -1
  187. package/dist/shared/{better-auth.SseKJGom.cjs → better-auth.CJnNI_pZ.cjs} +9 -4
  188. package/dist/shared/{better-auth.YSKz0i4l.mjs → better-auth.CSVqSIae.mjs} +1 -1
  189. package/dist/shared/{better-auth.CObM2dmq.d.ts → better-auth.CacwWJqS.d.ts} +4153 -2358
  190. package/dist/shared/{better-auth.B6ZMnKJn.d.cts → better-auth.Ce5ruaNV.d.cts} +158 -83
  191. package/dist/shared/{better-auth.BIT8gJC3.d.ts → better-auth.CgpkeCuV.d.ts} +1 -1
  192. package/dist/shared/{better-auth.24giT8Wv.cjs → better-auth.D4TPQEUm.cjs} +1 -1
  193. package/dist/shared/{better-auth.DnPdv1Yd.d.ts → better-auth.DOiM3a81.d.ts} +1 -1
  194. package/dist/shared/{better-auth.Ca00lafo.mjs → better-auth.D_z8y7iw.mjs} +57 -57
  195. package/dist/shared/{better-auth.f1dNo0RP.d.mts → better-auth.Gg7Z0WyK.d.mts} +158 -83
  196. package/dist/shared/{better-auth.CHNlACNP.d.mts → better-auth.NTBHOnXV.d.mts} +4153 -2358
  197. package/dist/shared/{better-auth.NcLhHEks.mjs → better-auth.VTXNLFMT.mjs} +15 -1
  198. package/dist/shared/{better-auth.GIePYJIY.d.cts → better-auth.mScwiXcw.d.cts} +1 -1
  199. package/dist/shared/{better-auth.D6mm0dKY.d.ts → better-auth.z5hCXEpq.d.ts} +158 -83
  200. package/dist/social-providers/index.cjs +68 -0
  201. package/dist/social-providers/index.d.cts +1 -1
  202. package/dist/social-providers/index.d.mts +1 -1
  203. package/dist/social-providers/index.d.ts +1 -1
  204. package/dist/social-providers/index.mjs +68 -1
  205. package/dist/types/index.d.cts +3 -3
  206. package/dist/types/index.d.mts +3 -3
  207. package/dist/types/index.d.ts +3 -3
  208. package/package.json +2 -2
  209. package/dist/shared/better-auth.BD_06JCz.cjs +0 -355
  210. package/dist/shared/better-auth.C5e60KER.mjs +0 -353
@@ -1,10 +1,10 @@
1
1
  'use strict';
2
2
 
3
- const proxy = require('../../shared/better-auth.DNb3Aogp.cjs');
3
+ const proxy = require('../../shared/better-auth.BN2jUYPL.cjs');
4
4
  const nanostores = require('nanostores');
5
5
  const react = require('react');
6
6
  require('@better-fetch/fetch');
7
- require('../../shared/better-auth.DhfiEsxl.cjs');
7
+ require('../../shared/better-auth.C-R0J0n1.cjs');
8
8
  require('../../shared/better-auth.DiSjtgs9.cjs');
9
9
  require('../../shared/better-auth.ANpbi45u.cjs');
10
10
  require('../../shared/better-auth.C_Zl7Etp.cjs');
@@ -6,11 +6,11 @@ export * from '@better-fetch/fetch';
6
6
  import { ClientOptions, BetterAuthClientPlugin, IsSignal, InferClientAPI, InferActions, InferErrorCodes } from '../../types/index.cjs';
7
7
  import { U as UnionToIntersection, P as PrettifyDeep } from '../../shared/better-auth.Bi8FQwDD.cjs';
8
8
  import { DependencyList } from 'react';
9
- import { h as BASE_ERROR_CODES } from '../../shared/better-auth.B6ZMnKJn.cjs';
9
+ import { h as BASE_ERROR_CODES } from '../../shared/better-auth.Ce5ruaNV.cjs';
10
10
  import 'better-call';
11
11
  import 'zod';
12
12
  import 'kysely';
13
- import '../../shared/better-auth.GFrhA2ZN.cjs';
13
+ import '../../shared/better-auth.B36e4YUo.cjs';
14
14
  import 'jose';
15
15
  import 'better-sqlite3';
16
16
 
@@ -6,11 +6,11 @@ export * from '@better-fetch/fetch';
6
6
  import { ClientOptions, BetterAuthClientPlugin, IsSignal, InferClientAPI, InferActions, InferErrorCodes } from '../../types/index.mjs';
7
7
  import { U as UnionToIntersection, P as PrettifyDeep } from '../../shared/better-auth.Bi8FQwDD.mjs';
8
8
  import { DependencyList } from 'react';
9
- import { h as BASE_ERROR_CODES } from '../../shared/better-auth.f1dNo0RP.mjs';
9
+ import { h as BASE_ERROR_CODES } from '../../shared/better-auth.Gg7Z0WyK.mjs';
10
10
  import 'better-call';
11
11
  import 'zod';
12
12
  import 'kysely';
13
- import '../../shared/better-auth.Dzvtygs8.mjs';
13
+ import '../../shared/better-auth.C7bUpbPE.mjs';
14
14
  import 'jose';
15
15
  import 'better-sqlite3';
16
16
 
@@ -6,11 +6,11 @@ export * from '@better-fetch/fetch';
6
6
  import { ClientOptions, BetterAuthClientPlugin, IsSignal, InferClientAPI, InferActions, InferErrorCodes } from '../../types/index.js';
7
7
  import { U as UnionToIntersection, P as PrettifyDeep } from '../../shared/better-auth.Bi8FQwDD.js';
8
8
  import { DependencyList } from 'react';
9
- import { h as BASE_ERROR_CODES } from '../../shared/better-auth.D6mm0dKY.js';
9
+ import { h as BASE_ERROR_CODES } from '../../shared/better-auth.z5hCXEpq.js';
10
10
  import 'better-call';
11
11
  import 'zod';
12
12
  import 'kysely';
13
- import '../../shared/better-auth.BRpbZ8Wm.js';
13
+ import '../../shared/better-auth.2gyOPXIw.js';
14
14
  import 'jose';
15
15
  import 'better-sqlite3';
16
16
 
@@ -1,8 +1,8 @@
1
- import { g as getClientConfig, c as createDynamicPathProxy } from '../../shared/better-auth.YSKz0i4l.mjs';
1
+ import { g as getClientConfig, c as createDynamicPathProxy } from '../../shared/better-auth.CSVqSIae.mjs';
2
2
  import { listenKeys } from 'nanostores';
3
3
  import { useRef, useCallback, useSyncExternalStore } from 'react';
4
4
  import '@better-fetch/fetch';
5
- import '../../shared/better-auth.NcLhHEks.mjs';
5
+ import '../../shared/better-auth.VTXNLFMT.mjs';
6
6
  import '../../shared/better-auth.8zoxzg-F.mjs';
7
7
  import '../../shared/better-auth.DdzSJf-n.mjs';
8
8
  import '../../shared/better-auth.CQvoVIBD.mjs';
@@ -1,11 +1,11 @@
1
1
  'use strict';
2
2
 
3
- const proxy = require('../../shared/better-auth.DNb3Aogp.cjs');
3
+ const proxy = require('../../shared/better-auth.BN2jUYPL.cjs');
4
4
  const misc = require('../../shared/better-auth.BLDOwz3i.cjs');
5
5
  const store = require('solid-js/store');
6
6
  const solidJs = require('solid-js');
7
7
  require('@better-fetch/fetch');
8
- require('../../shared/better-auth.DhfiEsxl.cjs');
8
+ require('../../shared/better-auth.C-R0J0n1.cjs');
9
9
  require('../../shared/better-auth.DiSjtgs9.cjs');
10
10
  require('../../shared/better-auth.ANpbi45u.cjs');
11
11
  require('nanostores');
@@ -1,14 +1,15 @@
1
1
  import * as _better_fetch_fetch from '@better-fetch/fetch';
2
2
  import { BetterFetchError } from '@better-fetch/fetch';
3
+ export * from '@better-fetch/fetch';
3
4
  import { ClientOptions, BetterAuthClientPlugin, IsSignal, InferClientAPI, InferActions, InferErrorCodes } from '../../types/index.cjs';
4
5
  import { Accessor } from 'solid-js';
5
6
  import { U as UnionToIntersection, P as PrettifyDeep } from '../../shared/better-auth.Bi8FQwDD.cjs';
6
- import { h as BASE_ERROR_CODES } from '../../shared/better-auth.B6ZMnKJn.cjs';
7
+ import { h as BASE_ERROR_CODES } from '../../shared/better-auth.Ce5ruaNV.cjs';
7
8
  import 'nanostores';
8
9
  import 'better-call';
9
10
  import 'zod';
10
11
  import 'kysely';
11
- import '../../shared/better-auth.GFrhA2ZN.cjs';
12
+ import '../../shared/better-auth.B36e4YUo.cjs';
12
13
  import 'jose';
13
14
  import 'better-sqlite3';
14
15
 
@@ -1,14 +1,15 @@
1
1
  import * as _better_fetch_fetch from '@better-fetch/fetch';
2
2
  import { BetterFetchError } from '@better-fetch/fetch';
3
+ export * from '@better-fetch/fetch';
3
4
  import { ClientOptions, BetterAuthClientPlugin, IsSignal, InferClientAPI, InferActions, InferErrorCodes } from '../../types/index.mjs';
4
5
  import { Accessor } from 'solid-js';
5
6
  import { U as UnionToIntersection, P as PrettifyDeep } from '../../shared/better-auth.Bi8FQwDD.mjs';
6
- import { h as BASE_ERROR_CODES } from '../../shared/better-auth.f1dNo0RP.mjs';
7
+ import { h as BASE_ERROR_CODES } from '../../shared/better-auth.Gg7Z0WyK.mjs';
7
8
  import 'nanostores';
8
9
  import 'better-call';
9
10
  import 'zod';
10
11
  import 'kysely';
11
- import '../../shared/better-auth.Dzvtygs8.mjs';
12
+ import '../../shared/better-auth.C7bUpbPE.mjs';
12
13
  import 'jose';
13
14
  import 'better-sqlite3';
14
15
 
@@ -1,14 +1,15 @@
1
1
  import * as _better_fetch_fetch from '@better-fetch/fetch';
2
2
  import { BetterFetchError } from '@better-fetch/fetch';
3
+ export * from '@better-fetch/fetch';
3
4
  import { ClientOptions, BetterAuthClientPlugin, IsSignal, InferClientAPI, InferActions, InferErrorCodes } from '../../types/index.js';
4
5
  import { Accessor } from 'solid-js';
5
6
  import { U as UnionToIntersection, P as PrettifyDeep } from '../../shared/better-auth.Bi8FQwDD.js';
6
- import { h as BASE_ERROR_CODES } from '../../shared/better-auth.D6mm0dKY.js';
7
+ import { h as BASE_ERROR_CODES } from '../../shared/better-auth.z5hCXEpq.js';
7
8
  import 'nanostores';
8
9
  import 'better-call';
9
10
  import 'zod';
10
11
  import 'kysely';
11
- import '../../shared/better-auth.BRpbZ8Wm.js';
12
+ import '../../shared/better-auth.2gyOPXIw.js';
12
13
  import 'jose';
13
14
  import 'better-sqlite3';
14
15
 
@@ -1,9 +1,9 @@
1
- import { g as getClientConfig, c as createDynamicPathProxy } from '../../shared/better-auth.YSKz0i4l.mjs';
1
+ import { g as getClientConfig, c as createDynamicPathProxy } from '../../shared/better-auth.CSVqSIae.mjs';
2
2
  import { c as capitalizeFirstLetter } from '../../shared/better-auth.D-2CmEwz.mjs';
3
3
  import { createStore, reconcile } from 'solid-js/store';
4
4
  import { onCleanup } from 'solid-js';
5
5
  import '@better-fetch/fetch';
6
- import '../../shared/better-auth.NcLhHEks.mjs';
6
+ import '../../shared/better-auth.VTXNLFMT.mjs';
7
7
  import '../../shared/better-auth.8zoxzg-F.mjs';
8
8
  import '../../shared/better-auth.DdzSJf-n.mjs';
9
9
  import 'nanostores';
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
- const proxy = require('../../shared/better-auth.DNb3Aogp.cjs');
3
+ const proxy = require('../../shared/better-auth.BN2jUYPL.cjs');
4
4
  const misc = require('../../shared/better-auth.BLDOwz3i.cjs');
5
5
  require('@better-fetch/fetch');
6
- require('../../shared/better-auth.DhfiEsxl.cjs');
6
+ require('../../shared/better-auth.C-R0J0n1.cjs');
7
7
  require('../../shared/better-auth.DiSjtgs9.cjs');
8
8
  require('../../shared/better-auth.ANpbi45u.cjs');
9
9
  require('nanostores');
@@ -2,13 +2,14 @@ import * as nanostores from 'nanostores';
2
2
  import { Atom } from 'nanostores';
3
3
  import * as _better_fetch_fetch from '@better-fetch/fetch';
4
4
  import { BetterFetchError } from '@better-fetch/fetch';
5
+ export * from '@better-fetch/fetch';
5
6
  import { ClientOptions, BetterAuthClientPlugin, IsSignal, InferClientAPI, InferActions, InferErrorCodes } from '../../types/index.cjs';
6
7
  import { U as UnionToIntersection, P as PrettifyDeep } from '../../shared/better-auth.Bi8FQwDD.cjs';
7
- import { h as BASE_ERROR_CODES } from '../../shared/better-auth.B6ZMnKJn.cjs';
8
+ import { h as BASE_ERROR_CODES } from '../../shared/better-auth.Ce5ruaNV.cjs';
8
9
  import 'better-call';
9
10
  import 'zod';
10
11
  import 'kysely';
11
- import '../../shared/better-auth.GFrhA2ZN.cjs';
12
+ import '../../shared/better-auth.B36e4YUo.cjs';
12
13
  import 'jose';
13
14
  import 'better-sqlite3';
14
15
 
@@ -2,13 +2,14 @@ import * as nanostores from 'nanostores';
2
2
  import { Atom } from 'nanostores';
3
3
  import * as _better_fetch_fetch from '@better-fetch/fetch';
4
4
  import { BetterFetchError } from '@better-fetch/fetch';
5
+ export * from '@better-fetch/fetch';
5
6
  import { ClientOptions, BetterAuthClientPlugin, IsSignal, InferClientAPI, InferActions, InferErrorCodes } from '../../types/index.mjs';
6
7
  import { U as UnionToIntersection, P as PrettifyDeep } from '../../shared/better-auth.Bi8FQwDD.mjs';
7
- import { h as BASE_ERROR_CODES } from '../../shared/better-auth.f1dNo0RP.mjs';
8
+ import { h as BASE_ERROR_CODES } from '../../shared/better-auth.Gg7Z0WyK.mjs';
8
9
  import 'better-call';
9
10
  import 'zod';
10
11
  import 'kysely';
11
- import '../../shared/better-auth.Dzvtygs8.mjs';
12
+ import '../../shared/better-auth.C7bUpbPE.mjs';
12
13
  import 'jose';
13
14
  import 'better-sqlite3';
14
15
 
@@ -2,13 +2,14 @@ import * as nanostores from 'nanostores';
2
2
  import { Atom } from 'nanostores';
3
3
  import * as _better_fetch_fetch from '@better-fetch/fetch';
4
4
  import { BetterFetchError } from '@better-fetch/fetch';
5
+ export * from '@better-fetch/fetch';
5
6
  import { ClientOptions, BetterAuthClientPlugin, IsSignal, InferClientAPI, InferActions, InferErrorCodes } from '../../types/index.js';
6
7
  import { U as UnionToIntersection, P as PrettifyDeep } from '../../shared/better-auth.Bi8FQwDD.js';
7
- import { h as BASE_ERROR_CODES } from '../../shared/better-auth.D6mm0dKY.js';
8
+ import { h as BASE_ERROR_CODES } from '../../shared/better-auth.z5hCXEpq.js';
8
9
  import 'better-call';
9
10
  import 'zod';
10
11
  import 'kysely';
11
- import '../../shared/better-auth.BRpbZ8Wm.js';
12
+ import '../../shared/better-auth.2gyOPXIw.js';
12
13
  import 'jose';
13
14
  import 'better-sqlite3';
14
15
 
@@ -1,7 +1,7 @@
1
- import { g as getClientConfig, c as createDynamicPathProxy } from '../../shared/better-auth.YSKz0i4l.mjs';
1
+ import { g as getClientConfig, c as createDynamicPathProxy } from '../../shared/better-auth.CSVqSIae.mjs';
2
2
  import { c as capitalizeFirstLetter } from '../../shared/better-auth.D-2CmEwz.mjs';
3
3
  import '@better-fetch/fetch';
4
- import '../../shared/better-auth.NcLhHEks.mjs';
4
+ import '../../shared/better-auth.VTXNLFMT.mjs';
5
5
  import '../../shared/better-auth.8zoxzg-F.mjs';
6
6
  import '../../shared/better-auth.DdzSJf-n.mjs';
7
7
  import 'nanostores';
@@ -1,10 +1,10 @@
1
1
  'use strict';
2
2
 
3
3
  const vue = require('vue');
4
- const proxy = require('../../shared/better-auth.DNb3Aogp.cjs');
4
+ const proxy = require('../../shared/better-auth.BN2jUYPL.cjs');
5
5
  const misc = require('../../shared/better-auth.BLDOwz3i.cjs');
6
6
  require('@better-fetch/fetch');
7
- require('../../shared/better-auth.DhfiEsxl.cjs');
7
+ require('../../shared/better-auth.C-R0J0n1.cjs');
8
8
  require('../../shared/better-auth.DiSjtgs9.cjs');
9
9
  require('../../shared/better-auth.ANpbi45u.cjs');
10
10
  require('nanostores');
@@ -1,14 +1,15 @@
1
1
  import * as nanostores from 'nanostores';
2
2
  import * as _better_fetch_fetch from '@better-fetch/fetch';
3
3
  import { BetterFetchError } from '@better-fetch/fetch';
4
+ export * from '@better-fetch/fetch';
4
5
  import { DeepReadonly, Ref } from 'vue';
5
6
  import { ClientOptions, BetterAuthClientPlugin, IsSignal, InferClientAPI, InferActions, InferErrorCodes } from '../../types/index.cjs';
6
7
  import { U as UnionToIntersection, P as PrettifyDeep } from '../../shared/better-auth.Bi8FQwDD.cjs';
7
- import { h as BASE_ERROR_CODES } from '../../shared/better-auth.B6ZMnKJn.cjs';
8
+ import { h as BASE_ERROR_CODES } from '../../shared/better-auth.Ce5ruaNV.cjs';
8
9
  import 'better-call';
9
10
  import 'zod';
10
11
  import 'kysely';
11
- import '../../shared/better-auth.GFrhA2ZN.cjs';
12
+ import '../../shared/better-auth.B36e4YUo.cjs';
12
13
  import 'jose';
13
14
  import 'better-sqlite3';
14
15
 
@@ -1,14 +1,15 @@
1
1
  import * as nanostores from 'nanostores';
2
2
  import * as _better_fetch_fetch from '@better-fetch/fetch';
3
3
  import { BetterFetchError } from '@better-fetch/fetch';
4
+ export * from '@better-fetch/fetch';
4
5
  import { DeepReadonly, Ref } from 'vue';
5
6
  import { ClientOptions, BetterAuthClientPlugin, IsSignal, InferClientAPI, InferActions, InferErrorCodes } from '../../types/index.mjs';
6
7
  import { U as UnionToIntersection, P as PrettifyDeep } from '../../shared/better-auth.Bi8FQwDD.mjs';
7
- import { h as BASE_ERROR_CODES } from '../../shared/better-auth.f1dNo0RP.mjs';
8
+ import { h as BASE_ERROR_CODES } from '../../shared/better-auth.Gg7Z0WyK.mjs';
8
9
  import 'better-call';
9
10
  import 'zod';
10
11
  import 'kysely';
11
- import '../../shared/better-auth.Dzvtygs8.mjs';
12
+ import '../../shared/better-auth.C7bUpbPE.mjs';
12
13
  import 'jose';
13
14
  import 'better-sqlite3';
14
15
 
@@ -1,14 +1,15 @@
1
1
  import * as nanostores from 'nanostores';
2
2
  import * as _better_fetch_fetch from '@better-fetch/fetch';
3
3
  import { BetterFetchError } from '@better-fetch/fetch';
4
+ export * from '@better-fetch/fetch';
4
5
  import { DeepReadonly, Ref } from 'vue';
5
6
  import { ClientOptions, BetterAuthClientPlugin, IsSignal, InferClientAPI, InferActions, InferErrorCodes } from '../../types/index.js';
6
7
  import { U as UnionToIntersection, P as PrettifyDeep } from '../../shared/better-auth.Bi8FQwDD.js';
7
- import { h as BASE_ERROR_CODES } from '../../shared/better-auth.D6mm0dKY.js';
8
+ import { h as BASE_ERROR_CODES } from '../../shared/better-auth.z5hCXEpq.js';
8
9
  import 'better-call';
9
10
  import 'zod';
10
11
  import 'kysely';
11
- import '../../shared/better-auth.BRpbZ8Wm.js';
12
+ import '../../shared/better-auth.2gyOPXIw.js';
12
13
  import 'jose';
13
14
  import 'better-sqlite3';
14
15
 
@@ -1,8 +1,8 @@
1
1
  import { shallowRef, getCurrentScope, onScopeDispose, readonly, getCurrentInstance } from 'vue';
2
- import { g as getClientConfig, c as createDynamicPathProxy } from '../../shared/better-auth.YSKz0i4l.mjs';
2
+ import { g as getClientConfig, c as createDynamicPathProxy } from '../../shared/better-auth.CSVqSIae.mjs';
3
3
  import { c as capitalizeFirstLetter } from '../../shared/better-auth.D-2CmEwz.mjs';
4
4
  import '@better-fetch/fetch';
5
- import '../../shared/better-auth.NcLhHEks.mjs';
5
+ import '../../shared/better-auth.VTXNLFMT.mjs';
6
6
  import '../../shared/better-auth.8zoxzg-F.mjs';
7
7
  import '../../shared/better-auth.DdzSJf-n.mjs';
8
8
  import 'nanostores';
@@ -355,8 +355,12 @@ const getSessionCookie = (request, config) => {
355
355
  if (!cookies) {
356
356
  return null;
357
357
  }
358
- const { cookieName = "session_token", cookiePrefix = "better-auth" } = config || {};
359
- const name = env.isProduction ? `__Secure-${cookiePrefix}.${cookieName}` : `${cookiePrefix}.${cookieName}`;
358
+ const {
359
+ cookieName = "session_token",
360
+ cookiePrefix = "better-auth",
361
+ useSecureCookies = request instanceof Request && env.isProduction && request.url.startsWith("https://") || (request instanceof Request && request.url.startsWith("https://") ? true : false)
362
+ } = config || {};
363
+ const name = useSecureCookies ? `__Secure-${cookiePrefix}.${cookieName}` : `${cookiePrefix}.${cookieName}`;
360
364
  const parsedCookie = parseCookies(cookies);
361
365
  const sessionToken = parsedCookie.get(name);
362
366
  if (sessionToken) {
@@ -1,8 +1,8 @@
1
1
  import 'better-call';
2
- export { aq as BetterAuthCookies, av as EligibleCookies, ao as createCookieGetter, at as deleteSessionCookie, ax as getCookieCache, ap as getCookies, aw as getSessionCookie, au as parseCookies, ay as parseSetCookieHeader, ar as setCookieCache, az as setCookieToHeader, as as setSessionCookie } from '../shared/better-auth.B6ZMnKJn.cjs';
2
+ export { aq as BetterAuthCookies, av as EligibleCookies, ao as createCookieGetter, at as deleteSessionCookie, ax as getCookieCache, ap as getCookies, aw as getSessionCookie, au as parseCookies, ay as parseSetCookieHeader, ar as setCookieCache, az as setCookieToHeader, as as setSessionCookie } from '../shared/better-auth.Ce5ruaNV.cjs';
3
3
  import '../shared/better-auth.Bi8FQwDD.cjs';
4
4
  import 'zod';
5
5
  import 'kysely';
6
- import '../shared/better-auth.GFrhA2ZN.cjs';
6
+ import '../shared/better-auth.B36e4YUo.cjs';
7
7
  import 'jose';
8
8
  import 'better-sqlite3';
@@ -1,8 +1,8 @@
1
1
  import 'better-call';
2
- export { aq as BetterAuthCookies, av as EligibleCookies, ao as createCookieGetter, at as deleteSessionCookie, ax as getCookieCache, ap as getCookies, aw as getSessionCookie, au as parseCookies, ay as parseSetCookieHeader, ar as setCookieCache, az as setCookieToHeader, as as setSessionCookie } from '../shared/better-auth.f1dNo0RP.mjs';
2
+ export { aq as BetterAuthCookies, av as EligibleCookies, ao as createCookieGetter, at as deleteSessionCookie, ax as getCookieCache, ap as getCookies, aw as getSessionCookie, au as parseCookies, ay as parseSetCookieHeader, ar as setCookieCache, az as setCookieToHeader, as as setSessionCookie } from '../shared/better-auth.Gg7Z0WyK.mjs';
3
3
  import '../shared/better-auth.Bi8FQwDD.mjs';
4
4
  import 'zod';
5
5
  import 'kysely';
6
- import '../shared/better-auth.Dzvtygs8.mjs';
6
+ import '../shared/better-auth.C7bUpbPE.mjs';
7
7
  import 'jose';
8
8
  import 'better-sqlite3';
@@ -1,8 +1,8 @@
1
1
  import 'better-call';
2
- export { aq as BetterAuthCookies, av as EligibleCookies, ao as createCookieGetter, at as deleteSessionCookie, ax as getCookieCache, ap as getCookies, aw as getSessionCookie, au as parseCookies, ay as parseSetCookieHeader, ar as setCookieCache, az as setCookieToHeader, as as setSessionCookie } from '../shared/better-auth.D6mm0dKY.js';
2
+ export { aq as BetterAuthCookies, av as EligibleCookies, ao as createCookieGetter, at as deleteSessionCookie, ax as getCookieCache, ap as getCookies, aw as getSessionCookie, au as parseCookies, ay as parseSetCookieHeader, ar as setCookieCache, az as setCookieToHeader, as as setSessionCookie } from '../shared/better-auth.z5hCXEpq.js';
3
3
  import '../shared/better-auth.Bi8FQwDD.js';
4
4
  import 'zod';
5
5
  import 'kysely';
6
- import '../shared/better-auth.BRpbZ8Wm.js';
6
+ import '../shared/better-auth.2gyOPXIw.js';
7
7
  import 'jose';
8
8
  import 'better-sqlite3';
@@ -353,8 +353,12 @@ const getSessionCookie = (request, config) => {
353
353
  if (!cookies) {
354
354
  return null;
355
355
  }
356
- const { cookieName = "session_token", cookiePrefix = "better-auth" } = config || {};
357
- const name = isProduction ? `__Secure-${cookiePrefix}.${cookieName}` : `${cookiePrefix}.${cookieName}`;
356
+ const {
357
+ cookieName = "session_token",
358
+ cookiePrefix = "better-auth",
359
+ useSecureCookies = request instanceof Request && isProduction && request.url.startsWith("https://") || (request instanceof Request && request.url.startsWith("https://") ? true : false)
360
+ } = config || {};
361
+ const name = useSecureCookies ? `__Secure-${cookiePrefix}.${cookieName}` : `${cookiePrefix}.${cookieName}`;
358
362
  const parsedCookie = parseCookies(cookies);
359
363
  const sessionToken = parsedCookie.get(name);
360
364
  if (sessionToken) {
@@ -14,7 +14,7 @@ declare const verifyPassword: ({ hash, password, }: {
14
14
  password: string;
15
15
  }) => Promise<boolean>;
16
16
 
17
- declare const generateRandomString: <SubA extends "a-z" | "A-Z" | "0-9" | "-_">(length: number, alphabet?: SubA | undefined, ...arg_1: SubA[]) => string;
17
+ declare const generateRandomString: <SubA extends "a-z" | "A-Z" | "0-9" | "-_">(length: number, ...alphabets: SubA[]) => string;
18
18
 
19
19
  type SymmetricEncryptOptions = {
20
20
  key: string;
@@ -14,7 +14,7 @@ declare const verifyPassword: ({ hash, password, }: {
14
14
  password: string;
15
15
  }) => Promise<boolean>;
16
16
 
17
- declare const generateRandomString: <SubA extends "a-z" | "A-Z" | "0-9" | "-_">(length: number, alphabet?: SubA | undefined, ...arg_1: SubA[]) => string;
17
+ declare const generateRandomString: <SubA extends "a-z" | "A-Z" | "0-9" | "-_">(length: number, ...alphabets: SubA[]) => string;
18
18
 
19
19
  type SymmetricEncryptOptions = {
20
20
  key: string;
@@ -14,7 +14,7 @@ declare const verifyPassword: ({ hash, password, }: {
14
14
  password: string;
15
15
  }) => Promise<boolean>;
16
16
 
17
- declare const generateRandomString: <SubA extends "a-z" | "A-Z" | "0-9" | "-_">(length: number, alphabet?: SubA | undefined, ...arg_1: SubA[]) => string;
17
+ declare const generateRandomString: <SubA extends "a-z" | "A-Z" | "0-9" | "-_">(length: number, ...alphabets: SubA[]) => string;
18
18
 
19
19
  type SymmetricEncryptOptions = {
20
20
  key: string;
@@ -1,10 +1,10 @@
1
- import { g as Adapter, f as BetterAuthOptions, G as GenericEndpointContext, W as Where, T as FieldAttribute, X as FieldType, K as KyselyDatabaseType } from '../shared/better-auth.B6ZMnKJn.cjs';
2
- export { a7 as BetterAuthDbSchema, _ as FieldAttributeConfig, a6 as InferFieldsFromOptions, a5 as InferFieldsFromPlugins, a2 as InferFieldsInput, a3 as InferFieldsInputClient, a1 as InferFieldsOutput, a0 as InferValueType, Z as InternalAdapter, a4 as PluginFieldAttribute, a9 as accountSchema, $ as createFieldAttribute, Y as createInternalAdapter, ae as getAllFields, a8 as getAuthTables, an as mergeSchema, al as parseAccountInput, ag as parseAccountOutput, ak as parseAdditionalUserInput, ai as parseInputData, ad as parseOutputData, am as parseSessionInput, ah as parseSessionOutput, aj as parseUserInput, af as parseUserOutput, ab as sessionSchema, aa as userSchema, ac as verificationSchema } from '../shared/better-auth.B6ZMnKJn.cjs';
1
+ import { g as Adapter, f as BetterAuthOptions, G as GenericEndpointContext, W as Where, T as FieldAttribute, X as FieldType, K as KyselyDatabaseType } from '../shared/better-auth.Ce5ruaNV.cjs';
2
+ export { a7 as BetterAuthDbSchema, _ as FieldAttributeConfig, a6 as InferFieldsFromOptions, a5 as InferFieldsFromPlugins, a2 as InferFieldsInput, a3 as InferFieldsInputClient, a1 as InferFieldsOutput, a0 as InferValueType, Z as InternalAdapter, a4 as PluginFieldAttribute, a9 as accountSchema, $ as createFieldAttribute, Y as createInternalAdapter, ae as getAllFields, a8 as getAuthTables, an as mergeSchema, al as parseAccountInput, ag as parseAccountOutput, ak as parseAdditionalUserInput, ai as parseInputData, ad as parseOutputData, am as parseSessionInput, ah as parseSessionOutput, aj as parseUserInput, af as parseUserOutput, ab as sessionSchema, aa as userSchema, ac as verificationSchema } from '../shared/better-auth.Ce5ruaNV.cjs';
3
3
  import { z } from 'zod';
4
4
  import '../shared/better-auth.Bi8FQwDD.cjs';
5
5
  import 'kysely';
6
6
  import 'better-call';
7
- import '../shared/better-auth.GFrhA2ZN.cjs';
7
+ import '../shared/better-auth.B36e4YUo.cjs';
8
8
  import 'jose';
9
9
  import 'better-sqlite3';
10
10
 
@@ -1,10 +1,10 @@
1
- import { g as Adapter, f as BetterAuthOptions, G as GenericEndpointContext, W as Where, T as FieldAttribute, X as FieldType, K as KyselyDatabaseType } from '../shared/better-auth.f1dNo0RP.mjs';
2
- export { a7 as BetterAuthDbSchema, _ as FieldAttributeConfig, a6 as InferFieldsFromOptions, a5 as InferFieldsFromPlugins, a2 as InferFieldsInput, a3 as InferFieldsInputClient, a1 as InferFieldsOutput, a0 as InferValueType, Z as InternalAdapter, a4 as PluginFieldAttribute, a9 as accountSchema, $ as createFieldAttribute, Y as createInternalAdapter, ae as getAllFields, a8 as getAuthTables, an as mergeSchema, al as parseAccountInput, ag as parseAccountOutput, ak as parseAdditionalUserInput, ai as parseInputData, ad as parseOutputData, am as parseSessionInput, ah as parseSessionOutput, aj as parseUserInput, af as parseUserOutput, ab as sessionSchema, aa as userSchema, ac as verificationSchema } from '../shared/better-auth.f1dNo0RP.mjs';
1
+ import { g as Adapter, f as BetterAuthOptions, G as GenericEndpointContext, W as Where, T as FieldAttribute, X as FieldType, K as KyselyDatabaseType } from '../shared/better-auth.Gg7Z0WyK.mjs';
2
+ export { a7 as BetterAuthDbSchema, _ as FieldAttributeConfig, a6 as InferFieldsFromOptions, a5 as InferFieldsFromPlugins, a2 as InferFieldsInput, a3 as InferFieldsInputClient, a1 as InferFieldsOutput, a0 as InferValueType, Z as InternalAdapter, a4 as PluginFieldAttribute, a9 as accountSchema, $ as createFieldAttribute, Y as createInternalAdapter, ae as getAllFields, a8 as getAuthTables, an as mergeSchema, al as parseAccountInput, ag as parseAccountOutput, ak as parseAdditionalUserInput, ai as parseInputData, ad as parseOutputData, am as parseSessionInput, ah as parseSessionOutput, aj as parseUserInput, af as parseUserOutput, ab as sessionSchema, aa as userSchema, ac as verificationSchema } from '../shared/better-auth.Gg7Z0WyK.mjs';
3
3
  import { z } from 'zod';
4
4
  import '../shared/better-auth.Bi8FQwDD.mjs';
5
5
  import 'kysely';
6
6
  import 'better-call';
7
- import '../shared/better-auth.Dzvtygs8.mjs';
7
+ import '../shared/better-auth.C7bUpbPE.mjs';
8
8
  import 'jose';
9
9
  import 'better-sqlite3';
10
10
 
@@ -1,10 +1,10 @@
1
- import { g as Adapter, f as BetterAuthOptions, G as GenericEndpointContext, W as Where, T as FieldAttribute, X as FieldType, K as KyselyDatabaseType } from '../shared/better-auth.D6mm0dKY.js';
2
- export { a7 as BetterAuthDbSchema, _ as FieldAttributeConfig, a6 as InferFieldsFromOptions, a5 as InferFieldsFromPlugins, a2 as InferFieldsInput, a3 as InferFieldsInputClient, a1 as InferFieldsOutput, a0 as InferValueType, Z as InternalAdapter, a4 as PluginFieldAttribute, a9 as accountSchema, $ as createFieldAttribute, Y as createInternalAdapter, ae as getAllFields, a8 as getAuthTables, an as mergeSchema, al as parseAccountInput, ag as parseAccountOutput, ak as parseAdditionalUserInput, ai as parseInputData, ad as parseOutputData, am as parseSessionInput, ah as parseSessionOutput, aj as parseUserInput, af as parseUserOutput, ab as sessionSchema, aa as userSchema, ac as verificationSchema } from '../shared/better-auth.D6mm0dKY.js';
1
+ import { g as Adapter, f as BetterAuthOptions, G as GenericEndpointContext, W as Where, T as FieldAttribute, X as FieldType, K as KyselyDatabaseType } from '../shared/better-auth.z5hCXEpq.js';
2
+ export { a7 as BetterAuthDbSchema, _ as FieldAttributeConfig, a6 as InferFieldsFromOptions, a5 as InferFieldsFromPlugins, a2 as InferFieldsInput, a3 as InferFieldsInputClient, a1 as InferFieldsOutput, a0 as InferValueType, Z as InternalAdapter, a4 as PluginFieldAttribute, a9 as accountSchema, $ as createFieldAttribute, Y as createInternalAdapter, ae as getAllFields, a8 as getAuthTables, an as mergeSchema, al as parseAccountInput, ag as parseAccountOutput, ak as parseAdditionalUserInput, ai as parseInputData, ad as parseOutputData, am as parseSessionInput, ah as parseSessionOutput, aj as parseUserInput, af as parseUserOutput, ab as sessionSchema, aa as userSchema, ac as verificationSchema } from '../shared/better-auth.z5hCXEpq.js';
3
3
  import { z } from 'zod';
4
4
  import '../shared/better-auth.Bi8FQwDD.js';
5
5
  import 'kysely';
6
6
  import 'better-call';
7
- import '../shared/better-auth.BRpbZ8Wm.js';
7
+ import '../shared/better-auth.2gyOPXIw.js';
8
8
  import 'jose';
9
9
  import 'better-sqlite3';
10
10
 
package/dist/index.cjs CHANGED
@@ -21,9 +21,9 @@ require('jose');
21
21
  require('./shared/better-auth.CYeOI8C-.cjs');
22
22
  const env = require('./shared/better-auth.DiSjtgs9.cjs');
23
23
  const password$1 = require('./shared/better-auth.CDXNofOe.cjs');
24
- const url = require('./shared/better-auth.DhfiEsxl.cjs');
24
+ const url = require('./shared/better-auth.C-R0J0n1.cjs');
25
25
  const index = require('./shared/better-auth.ANpbi45u.cjs');
26
- const account = require('./shared/better-auth.BvdK2HVj.cjs');
26
+ const account = require('./shared/better-auth.Bwt75GhP.cjs');
27
27
  const misc = require('./shared/better-auth.BLDOwz3i.cjs');
28
28
  const state = require('./shared/better-auth.CHHC_PJT.cjs');
29
29
  require('./shared/better-auth.BgkOX1Ei.cjs');
@@ -222,16 +222,20 @@ const betterAuth = (options) => {
222
222
  handler: async (request) => {
223
223
  const ctx = await authContext;
224
224
  const basePath = ctx.options.basePath || "/api/auth";
225
- const url$1 = new URL(request.url);
226
225
  if (!ctx.options.baseURL) {
227
- const baseURL = url.getBaseURL(void 0, basePath) || `${url$1.origin}${basePath}`;
228
- ctx.options.baseURL = baseURL;
229
- ctx.baseURL = baseURL;
226
+ const baseURL = url.getBaseURL(void 0, basePath, request);
227
+ if (baseURL) {
228
+ ctx.baseURL = baseURL;
229
+ ctx.options.baseURL = url.getOrigin(ctx.baseURL) || void 0;
230
+ } else {
231
+ throw new index.BetterAuthError(
232
+ "Could not get base URL from request. Please provide a valid base URL."
233
+ );
234
+ }
230
235
  }
231
236
  ctx.trustedOrigins = [
232
- ...options.trustedOrigins ? Array.isArray(options.trustedOrigins) ? options.trustedOrigins : options.trustedOrigins(request) : [],
233
- ctx.options.baseURL,
234
- url$1.origin
237
+ ...options.trustedOrigins ? Array.isArray(options.trustedOrigins) ? options.trustedOrigins : await options.trustedOrigins(request) : [],
238
+ ctx.options.baseURL
235
239
  ];
236
240
  const { handler } = api_index.router(ctx, options);
237
241
  return handler(request);
package/dist/index.d.cts CHANGED
@@ -1,12 +1,12 @@
1
- export { u as Account, g as Adapter, x as AdapterInstance, w as AdapterSchemaCreation, r as AdditionalSessionFieldsInput, s as AdditionalSessionFieldsOutput, p as AdditionalUserFieldsInput, q as AdditionalUserFieldsOutput, i as Auth, l as AuthContext, A as AuthPluginSchema, f as BetterAuthOptions, B as BetterAuthPlugin, z as FilterActions, F as FilteredAPI, G as GenericEndpointContext, H as HookEndpointContext, D as InferAPI, I as InferOptionSchema, a as InferPluginErrorCodes, t as InferPluginTypes, k as InferSession, C as InferSessionAPI, j as InferUser, O as LogHandlerParams, L as LogLevel, N as Logger, M as Models, R as RateLimit, y as SecondaryStorage, S as Session, U as User, V as Verification, W as Where, m as WithJsDoc, n as betterAuth, P as createLogger, v as init, E as levels, Q as logger, J as shouldPublishLog } from './shared/better-auth.B6ZMnKJn.cjs';
1
+ export { u as Account, g as Adapter, x as AdapterInstance, w as AdapterSchemaCreation, r as AdditionalSessionFieldsInput, s as AdditionalSessionFieldsOutput, p as AdditionalUserFieldsInput, q as AdditionalUserFieldsOutput, i as Auth, l as AuthContext, A as AuthPluginSchema, f as BetterAuthOptions, B as BetterAuthPlugin, z as FilterActions, F as FilteredAPI, G as GenericEndpointContext, H as HookEndpointContext, D as InferAPI, I as InferOptionSchema, a as InferPluginErrorCodes, t as InferPluginTypes, k as InferSession, C as InferSessionAPI, j as InferUser, O as LogHandlerParams, L as LogLevel, N as Logger, M as Models, R as RateLimit, y as SecondaryStorage, S as Session, U as User, V as Verification, W as Where, m as WithJsDoc, n as betterAuth, P as createLogger, v as init, E as levels, Q as logger, J as shouldPublishLog } from './shared/better-auth.Ce5ruaNV.cjs';
2
2
  export { AtomListener, BetterAuthClientPlugin, ClientOptions, InferActions, InferAdditionalFromClient, InferClientAPI, InferErrorCodes, InferPluginsFromClient, InferSessionFromClient, InferUserFromClient, IsSignal, Store } from './types/index.cjs';
3
3
  export { H as HIDE_METADATA } from './shared/better-auth.DEHJp1rk.cjs';
4
- export { g as generateState, p as parseState } from './shared/better-auth.BO8ywGjx.cjs';
4
+ export { g as generateState, p as parseState } from './shared/better-auth.BAHeu7c0.cjs';
5
5
  export * from 'better-call';
6
6
  export * from 'zod';
7
7
  export { D as DeepPartial, E as Expand, H as HasRequiredKeys, a as LiteralNumber, L as LiteralString, d as LiteralUnion, O as OmitId, c as PreserveJSDoc, b as Prettify, P as PrettifyDeep, R as RequiredKeysOf, S as StripEmptyObjects, U as UnionToIntersection, W as WithoutEmpty } from './shared/better-auth.Bi8FQwDD.cjs';
8
8
  import 'kysely';
9
- import './shared/better-auth.GFrhA2ZN.cjs';
9
+ import './shared/better-auth.B36e4YUo.cjs';
10
10
  import 'jose';
11
11
  import 'better-sqlite3';
12
12
  import '@better-fetch/fetch';
package/dist/index.d.mts CHANGED
@@ -1,12 +1,12 @@
1
- export { u as Account, g as Adapter, x as AdapterInstance, w as AdapterSchemaCreation, r as AdditionalSessionFieldsInput, s as AdditionalSessionFieldsOutput, p as AdditionalUserFieldsInput, q as AdditionalUserFieldsOutput, i as Auth, l as AuthContext, A as AuthPluginSchema, f as BetterAuthOptions, B as BetterAuthPlugin, z as FilterActions, F as FilteredAPI, G as GenericEndpointContext, H as HookEndpointContext, D as InferAPI, I as InferOptionSchema, a as InferPluginErrorCodes, t as InferPluginTypes, k as InferSession, C as InferSessionAPI, j as InferUser, O as LogHandlerParams, L as LogLevel, N as Logger, M as Models, R as RateLimit, y as SecondaryStorage, S as Session, U as User, V as Verification, W as Where, m as WithJsDoc, n as betterAuth, P as createLogger, v as init, E as levels, Q as logger, J as shouldPublishLog } from './shared/better-auth.f1dNo0RP.mjs';
1
+ export { u as Account, g as Adapter, x as AdapterInstance, w as AdapterSchemaCreation, r as AdditionalSessionFieldsInput, s as AdditionalSessionFieldsOutput, p as AdditionalUserFieldsInput, q as AdditionalUserFieldsOutput, i as Auth, l as AuthContext, A as AuthPluginSchema, f as BetterAuthOptions, B as BetterAuthPlugin, z as FilterActions, F as FilteredAPI, G as GenericEndpointContext, H as HookEndpointContext, D as InferAPI, I as InferOptionSchema, a as InferPluginErrorCodes, t as InferPluginTypes, k as InferSession, C as InferSessionAPI, j as InferUser, O as LogHandlerParams, L as LogLevel, N as Logger, M as Models, R as RateLimit, y as SecondaryStorage, S as Session, U as User, V as Verification, W as Where, m as WithJsDoc, n as betterAuth, P as createLogger, v as init, E as levels, Q as logger, J as shouldPublishLog } from './shared/better-auth.Gg7Z0WyK.mjs';
2
2
  export { AtomListener, BetterAuthClientPlugin, ClientOptions, InferActions, InferAdditionalFromClient, InferClientAPI, InferErrorCodes, InferPluginsFromClient, InferSessionFromClient, InferUserFromClient, IsSignal, Store } from './types/index.mjs';
3
3
  export { H as HIDE_METADATA } from './shared/better-auth.DEHJp1rk.mjs';
4
- export { g as generateState, p as parseState } from './shared/better-auth.A0dcaQJJ.mjs';
4
+ export { g as generateState, p as parseState } from './shared/better-auth.CIlYLU40.mjs';
5
5
  export * from 'better-call';
6
6
  export * from 'zod';
7
7
  export { D as DeepPartial, E as Expand, H as HasRequiredKeys, a as LiteralNumber, L as LiteralString, d as LiteralUnion, O as OmitId, c as PreserveJSDoc, b as Prettify, P as PrettifyDeep, R as RequiredKeysOf, S as StripEmptyObjects, U as UnionToIntersection, W as WithoutEmpty } from './shared/better-auth.Bi8FQwDD.mjs';
8
8
  import 'kysely';
9
- import './shared/better-auth.Dzvtygs8.mjs';
9
+ import './shared/better-auth.C7bUpbPE.mjs';
10
10
  import 'jose';
11
11
  import 'better-sqlite3';
12
12
  import '@better-fetch/fetch';
package/dist/index.d.ts CHANGED
@@ -1,12 +1,12 @@
1
- export { u as Account, g as Adapter, x as AdapterInstance, w as AdapterSchemaCreation, r as AdditionalSessionFieldsInput, s as AdditionalSessionFieldsOutput, p as AdditionalUserFieldsInput, q as AdditionalUserFieldsOutput, i as Auth, l as AuthContext, A as AuthPluginSchema, f as BetterAuthOptions, B as BetterAuthPlugin, z as FilterActions, F as FilteredAPI, G as GenericEndpointContext, H as HookEndpointContext, D as InferAPI, I as InferOptionSchema, a as InferPluginErrorCodes, t as InferPluginTypes, k as InferSession, C as InferSessionAPI, j as InferUser, O as LogHandlerParams, L as LogLevel, N as Logger, M as Models, R as RateLimit, y as SecondaryStorage, S as Session, U as User, V as Verification, W as Where, m as WithJsDoc, n as betterAuth, P as createLogger, v as init, E as levels, Q as logger, J as shouldPublishLog } from './shared/better-auth.D6mm0dKY.js';
1
+ export { u as Account, g as Adapter, x as AdapterInstance, w as AdapterSchemaCreation, r as AdditionalSessionFieldsInput, s as AdditionalSessionFieldsOutput, p as AdditionalUserFieldsInput, q as AdditionalUserFieldsOutput, i as Auth, l as AuthContext, A as AuthPluginSchema, f as BetterAuthOptions, B as BetterAuthPlugin, z as FilterActions, F as FilteredAPI, G as GenericEndpointContext, H as HookEndpointContext, D as InferAPI, I as InferOptionSchema, a as InferPluginErrorCodes, t as InferPluginTypes, k as InferSession, C as InferSessionAPI, j as InferUser, O as LogHandlerParams, L as LogLevel, N as Logger, M as Models, R as RateLimit, y as SecondaryStorage, S as Session, U as User, V as Verification, W as Where, m as WithJsDoc, n as betterAuth, P as createLogger, v as init, E as levels, Q as logger, J as shouldPublishLog } from './shared/better-auth.z5hCXEpq.js';
2
2
  export { AtomListener, BetterAuthClientPlugin, ClientOptions, InferActions, InferAdditionalFromClient, InferClientAPI, InferErrorCodes, InferPluginsFromClient, InferSessionFromClient, InferUserFromClient, IsSignal, Store } from './types/index.js';
3
3
  export { H as HIDE_METADATA } from './shared/better-auth.DEHJp1rk.js';
4
- export { g as generateState, p as parseState } from './shared/better-auth.DnPdv1Yd.js';
4
+ export { g as generateState, p as parseState } from './shared/better-auth.DOiM3a81.js';
5
5
  export * from 'better-call';
6
6
  export * from 'zod';
7
7
  export { D as DeepPartial, E as Expand, H as HasRequiredKeys, a as LiteralNumber, L as LiteralString, d as LiteralUnion, O as OmitId, c as PreserveJSDoc, b as Prettify, P as PrettifyDeep, R as RequiredKeysOf, S as StripEmptyObjects, U as UnionToIntersection, W as WithoutEmpty } from './shared/better-auth.Bi8FQwDD.js';
8
8
  import 'kysely';
9
- import './shared/better-auth.BRpbZ8Wm.js';
9
+ import './shared/better-auth.2gyOPXIw.js';
10
10
  import 'jose';
11
11
  import 'better-sqlite3';
12
12
  import '@better-fetch/fetch';