better-auth 1.2.5-beta.9 → 1.2.6-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 (197) hide show
  1. package/dist/adapters/drizzle-adapter/index.d.cts +3 -3
  2. package/dist/adapters/drizzle-adapter/index.d.mts +3 -3
  3. package/dist/adapters/drizzle-adapter/index.d.ts +3 -3
  4. package/dist/adapters/kysely-adapter/index.d.cts +3 -3
  5. package/dist/adapters/kysely-adapter/index.d.mts +3 -3
  6. package/dist/adapters/kysely-adapter/index.d.ts +3 -3
  7. package/dist/adapters/memory-adapter/index.d.cts +3 -3
  8. package/dist/adapters/memory-adapter/index.d.mts +3 -3
  9. package/dist/adapters/memory-adapter/index.d.ts +3 -3
  10. package/dist/adapters/mongodb-adapter/index.d.cts +3 -3
  11. package/dist/adapters/mongodb-adapter/index.d.mts +3 -3
  12. package/dist/adapters/mongodb-adapter/index.d.ts +3 -3
  13. package/dist/adapters/prisma-adapter/index.d.cts +3 -3
  14. package/dist/adapters/prisma-adapter/index.d.mts +3 -3
  15. package/dist/adapters/prisma-adapter/index.d.ts +3 -3
  16. package/dist/adapters/test.d.cts +3 -3
  17. package/dist/adapters/test.d.mts +3 -3
  18. package/dist/adapters/test.d.ts +3 -3
  19. package/dist/api/index.cjs +77 -75
  20. package/dist/api/index.d.cts +4 -4
  21. package/dist/api/index.d.mts +4 -4
  22. package/dist/api/index.d.ts +4 -4
  23. package/dist/api/index.mjs +6 -5
  24. package/dist/client/index.d.cts +4 -4
  25. package/dist/client/index.d.mts +4 -4
  26. package/dist/client/index.d.ts +4 -4
  27. package/dist/client/plugins/index.d.cts +4 -4
  28. package/dist/client/plugins/index.d.mts +4 -4
  29. package/dist/client/plugins/index.d.ts +4 -4
  30. package/dist/client/react/index.d.cts +4 -4
  31. package/dist/client/react/index.d.mts +4 -4
  32. package/dist/client/react/index.d.ts +4 -4
  33. package/dist/client/solid/index.d.cts +4 -4
  34. package/dist/client/solid/index.d.mts +4 -4
  35. package/dist/client/solid/index.d.ts +4 -4
  36. package/dist/client/svelte/index.d.cts +4 -4
  37. package/dist/client/svelte/index.d.mts +4 -4
  38. package/dist/client/svelte/index.d.ts +4 -4
  39. package/dist/client/vue/index.d.cts +4 -4
  40. package/dist/client/vue/index.d.mts +4 -4
  41. package/dist/client/vue/index.d.ts +4 -4
  42. package/dist/cookies/index.d.cts +3 -3
  43. package/dist/cookies/index.d.mts +3 -3
  44. package/dist/cookies/index.d.ts +3 -3
  45. package/dist/db/index.cjs +1 -1
  46. package/dist/db/index.d.cts +4 -4
  47. package/dist/db/index.d.mts +4 -4
  48. package/dist/db/index.d.ts +4 -4
  49. package/dist/db/index.mjs +1 -1
  50. package/dist/index.cjs +5 -5
  51. package/dist/index.d.cts +4 -4
  52. package/dist/index.d.mts +4 -4
  53. package/dist/index.d.ts +4 -4
  54. package/dist/index.mjs +4 -4
  55. package/dist/integrations/next-js.cjs +5 -5
  56. package/dist/integrations/next-js.d.cts +3 -3
  57. package/dist/integrations/next-js.d.mts +3 -3
  58. package/dist/integrations/next-js.d.ts +3 -3
  59. package/dist/integrations/next-js.mjs +4 -4
  60. package/dist/integrations/node.d.cts +3 -3
  61. package/dist/integrations/node.d.mts +3 -3
  62. package/dist/integrations/node.d.ts +3 -3
  63. package/dist/integrations/svelte-kit.d.cts +3 -3
  64. package/dist/integrations/svelte-kit.d.mts +3 -3
  65. package/dist/integrations/svelte-kit.d.ts +3 -3
  66. package/dist/oauth2/index.cjs +7 -6
  67. package/dist/oauth2/index.d.cts +14 -5
  68. package/dist/oauth2/index.d.mts +14 -5
  69. package/dist/oauth2/index.d.ts +14 -5
  70. package/dist/oauth2/index.mjs +1 -1
  71. package/dist/plugins/admin/index.cjs +3 -3
  72. package/dist/plugins/admin/index.d.cts +3 -3
  73. package/dist/plugins/admin/index.d.mts +3 -3
  74. package/dist/plugins/admin/index.d.ts +3 -3
  75. package/dist/plugins/admin/index.mjs +3 -3
  76. package/dist/plugins/anonymous/index.cjs +5 -5
  77. package/dist/plugins/anonymous/index.d.cts +3 -3
  78. package/dist/plugins/anonymous/index.d.mts +3 -3
  79. package/dist/plugins/anonymous/index.d.ts +3 -3
  80. package/dist/plugins/anonymous/index.mjs +2 -2
  81. package/dist/plugins/bearer/index.cjs +4 -4
  82. package/dist/plugins/bearer/index.d.cts +3 -3
  83. package/dist/plugins/bearer/index.d.mts +3 -3
  84. package/dist/plugins/bearer/index.d.ts +3 -3
  85. package/dist/plugins/bearer/index.mjs +2 -2
  86. package/dist/plugins/custom-session/index.cjs +4 -4
  87. package/dist/plugins/custom-session/index.d.cts +3 -3
  88. package/dist/plugins/custom-session/index.d.mts +3 -3
  89. package/dist/plugins/custom-session/index.d.ts +3 -3
  90. package/dist/plugins/custom-session/index.mjs +2 -2
  91. package/dist/plugins/email-otp/index.cjs +10 -10
  92. package/dist/plugins/email-otp/index.d.cts +3 -3
  93. package/dist/plugins/email-otp/index.d.mts +3 -3
  94. package/dist/plugins/email-otp/index.d.ts +3 -3
  95. package/dist/plugins/email-otp/index.mjs +2 -2
  96. package/dist/plugins/generic-oauth/index.cjs +43 -19
  97. package/dist/plugins/generic-oauth/index.d.cts +4 -4
  98. package/dist/plugins/generic-oauth/index.d.mts +4 -4
  99. package/dist/plugins/generic-oauth/index.d.ts +4 -4
  100. package/dist/plugins/generic-oauth/index.mjs +29 -5
  101. package/dist/plugins/index.cjs +22 -22
  102. package/dist/plugins/index.d.cts +4 -4
  103. package/dist/plugins/index.d.mts +4 -4
  104. package/dist/plugins/index.d.ts +4 -4
  105. package/dist/plugins/index.mjs +6 -6
  106. package/dist/plugins/jwt/index.cjs +6 -6
  107. package/dist/plugins/jwt/index.d.cts +3 -3
  108. package/dist/plugins/jwt/index.d.mts +3 -3
  109. package/dist/plugins/jwt/index.d.ts +3 -3
  110. package/dist/plugins/jwt/index.mjs +2 -2
  111. package/dist/plugins/magic-link/index.cjs +6 -6
  112. package/dist/plugins/magic-link/index.mjs +2 -2
  113. package/dist/plugins/multi-session/index.cjs +9 -9
  114. package/dist/plugins/multi-session/index.d.cts +3 -3
  115. package/dist/plugins/multi-session/index.d.mts +3 -3
  116. package/dist/plugins/multi-session/index.d.ts +3 -3
  117. package/dist/plugins/multi-session/index.mjs +2 -2
  118. package/dist/plugins/oauth-proxy/index.cjs +6 -6
  119. package/dist/plugins/oauth-proxy/index.d.cts +3 -3
  120. package/dist/plugins/oauth-proxy/index.d.mts +3 -3
  121. package/dist/plugins/oauth-proxy/index.d.ts +3 -3
  122. package/dist/plugins/oauth-proxy/index.mjs +2 -2
  123. package/dist/plugins/oidc-provider/index.cjs +14 -14
  124. package/dist/plugins/oidc-provider/index.d.cts +3 -3
  125. package/dist/plugins/oidc-provider/index.d.mts +3 -3
  126. package/dist/plugins/oidc-provider/index.d.ts +3 -3
  127. package/dist/plugins/oidc-provider/index.mjs +2 -2
  128. package/dist/plugins/one-tap/index.cjs +3 -3
  129. package/dist/plugins/one-tap/index.mjs +2 -2
  130. package/dist/plugins/open-api/index.cjs +4 -4
  131. package/dist/plugins/open-api/index.d.cts +3 -3
  132. package/dist/plugins/open-api/index.d.mts +3 -3
  133. package/dist/plugins/open-api/index.d.ts +3 -3
  134. package/dist/plugins/open-api/index.mjs +2 -2
  135. package/dist/plugins/organization/index.cjs +3 -3
  136. package/dist/plugins/organization/index.d.cts +3 -3
  137. package/dist/plugins/organization/index.d.mts +3 -3
  138. package/dist/plugins/organization/index.d.ts +3 -3
  139. package/dist/plugins/organization/index.mjs +3 -3
  140. package/dist/plugins/passkey/index.cjs +15 -15
  141. package/dist/plugins/passkey/index.d.cts +3 -3
  142. package/dist/plugins/passkey/index.d.mts +3 -3
  143. package/dist/plugins/passkey/index.d.ts +3 -3
  144. package/dist/plugins/passkey/index.mjs +2 -2
  145. package/dist/plugins/phone-number/index.cjs +13 -13
  146. package/dist/plugins/phone-number/index.d.cts +3 -3
  147. package/dist/plugins/phone-number/index.d.mts +3 -3
  148. package/dist/plugins/phone-number/index.d.ts +3 -3
  149. package/dist/plugins/phone-number/index.mjs +2 -2
  150. package/dist/plugins/sso/index.cjs +11 -11
  151. package/dist/plugins/sso/index.d.cts +2 -2
  152. package/dist/plugins/sso/index.d.mts +2 -2
  153. package/dist/plugins/sso/index.d.ts +2 -2
  154. package/dist/plugins/sso/index.mjs +3 -3
  155. package/dist/plugins/two-factor/index.cjs +20 -20
  156. package/dist/plugins/two-factor/index.d.cts +3 -3
  157. package/dist/plugins/two-factor/index.d.mts +3 -3
  158. package/dist/plugins/two-factor/index.d.ts +3 -3
  159. package/dist/plugins/two-factor/index.mjs +3 -3
  160. package/dist/plugins/username/index.cjs +9 -9
  161. package/dist/plugins/username/index.d.cts +3 -3
  162. package/dist/plugins/username/index.d.mts +3 -3
  163. package/dist/plugins/username/index.d.ts +3 -3
  164. package/dist/plugins/username/index.mjs +2 -2
  165. package/dist/shared/{better-auth.oyDBIJLs.mjs → better-auth.2rfXmCNS.mjs} +1 -1
  166. package/dist/shared/{better-auth.KTt7CS7L.mjs → better-auth.9knM1kR4.mjs} +1 -1
  167. package/dist/shared/{better-auth.DiMBK1Ep.mjs → better-auth.B2THyVQH.mjs} +54 -1
  168. package/dist/shared/{better-auth.C8tekzhG.cjs → better-auth.B7irTavj.cjs} +35 -35
  169. package/dist/shared/{better-auth.Dd96RDNl.d.ts → better-auth.BAfIsot3.d.ts} +41 -2
  170. package/dist/shared/{better-auth.Dunt9jpN.d.cts → better-auth.BBG0jAhH.d.mts} +2 -2
  171. package/dist/shared/{better-auth.CxMUffeh.d.cts → better-auth.BDAwKjlL.d.cts} +567 -46
  172. package/dist/shared/{better-auth.CbBX7Xla.mjs → better-auth.BK4Kh5QZ.mjs} +19 -17
  173. package/dist/shared/{better-auth.DgXCgiHI.cjs → better-auth.BLV8UOn8.cjs} +54 -0
  174. package/dist/shared/{better-auth.BjoUuJNr.d.mts → better-auth.BTnAiI8e.d.mts} +41 -2
  175. package/dist/shared/{better-auth.CzK7QJBv.d.cts → better-auth.CH6fRG6d.d.cts} +41 -2
  176. package/dist/shared/{better-auth.dzwyqpra.d.mts → better-auth.CTQDLJN7.d.mts} +567 -46
  177. package/dist/shared/{better-auth.CEuqoYDM.d.mts → better-auth.CtSY9Kmu.d.cts} +2 -2
  178. package/dist/shared/{better-auth.Cz2saE_0.d.cts → better-auth.DAnkIG1r.d.cts} +1 -1
  179. package/dist/shared/{better-auth.4ZqMps6Z.d.ts → better-auth.DCxEy-As.d.ts} +1 -1
  180. package/dist/shared/{better-auth.D7hUw1_Y.d.ts → better-auth.DIOWNBS2.d.ts} +1 -1
  181. package/dist/shared/{better-auth.ybwxmbrM.mjs → better-auth.DQ-pFMwp.mjs} +118 -5
  182. package/dist/shared/{better-auth.BxC2ipUB.d.mts → better-auth.DZPJQ81N.d.mts} +1 -1
  183. package/dist/shared/{better-auth.CL_N_Cfq.cjs → better-auth.DqGx7Ip8.cjs} +20 -20
  184. package/dist/shared/{better-auth.wspQErD2.cjs → better-auth.TNTVT6jt.cjs} +3 -3
  185. package/dist/shared/{better-auth.4J4_zAGP.cjs → better-auth.b0MLzqQX.cjs} +118 -4
  186. package/dist/shared/{better-auth.CdPDif0r.mjs → better-auth.cN4sTcuQ.mjs} +1 -1
  187. package/dist/shared/{better-auth.X0ynzeu1.cjs → better-auth.q7ChvjiM.cjs} +19 -17
  188. package/dist/shared/{better-auth.CixnJ90x.d.ts → better-auth.tpz8D0AA.d.ts} +567 -46
  189. package/dist/social-providers/index.cjs +197 -32
  190. package/dist/social-providers/index.d.cts +1 -1
  191. package/dist/social-providers/index.d.mts +1 -1
  192. package/dist/social-providers/index.d.ts +1 -1
  193. package/dist/social-providers/index.mjs +166 -1
  194. package/dist/types/index.d.cts +4 -4
  195. package/dist/types/index.d.mts +4 -4
  196. package/dist/types/index.d.ts +4 -4
  197. package/package.json +3 -3
@@ -4,7 +4,7 @@ const server = require('@simplewebauthn/server');
4
4
  const betterCall = require('better-call');
5
5
  const random = require('../../shared/better-auth.CYeOI8C-.cjs');
6
6
  const zod = require('zod');
7
- const account = require('../../shared/better-auth.4J4_zAGP.cjs');
7
+ const refreshToken = require('../../shared/better-auth.b0MLzqQX.cjs');
8
8
  const cookies_index = require('../../cookies/index.cjs');
9
9
  const schema$1 = require('../../shared/better-auth.C5H9XEzZ.cjs');
10
10
  require('../../shared/better-auth.DiSjtgs9.cjs');
@@ -24,7 +24,7 @@ require('@noble/hashes/utils');
24
24
  require('@better-auth/utils/random');
25
25
  require('../../social-providers/index.cjs');
26
26
  require('@better-fetch/fetch');
27
- require('../../shared/better-auth.DgXCgiHI.cjs');
27
+ require('../../shared/better-auth.BLV8UOn8.cjs');
28
28
  require('../../shared/better-auth.C1hdVENX.cjs');
29
29
  require('../../shared/better-auth.ANpbi45u.cjs');
30
30
  require('../../shared/better-auth.QbbyHMYf.cjs');
@@ -64,11 +64,11 @@ const passkey = (options) => {
64
64
  return {
65
65
  id: "passkey",
66
66
  endpoints: {
67
- generatePasskeyRegistrationOptions: account.createAuthEndpoint(
67
+ generatePasskeyRegistrationOptions: refreshToken.createAuthEndpoint(
68
68
  "/passkey/generate-register-options",
69
69
  {
70
70
  method: "GET",
71
- use: [account.freshSessionMiddleware],
71
+ use: [refreshToken.freshSessionMiddleware],
72
72
  query: zod.z.object({
73
73
  authenticatorAttachment: zod.z.enum(["platform", "cross-platform"]).optional()
74
74
  }).optional(),
@@ -252,7 +252,7 @@ const passkey = (options) => {
252
252
  });
253
253
  }
254
254
  ),
255
- generatePasskeyAuthenticationOptions: account.createAuthEndpoint(
255
+ generatePasskeyAuthenticationOptions: refreshToken.createAuthEndpoint(
256
256
  "/passkey/generate-authenticate-options",
257
257
  {
258
258
  method: "POST",
@@ -353,7 +353,7 @@ const passkey = (options) => {
353
353
  }
354
354
  },
355
355
  async (ctx) => {
356
- const session = await account.getSessionFromCtx(ctx);
356
+ const session = await refreshToken.getSessionFromCtx(ctx);
357
357
  let userPasskeys = [];
358
358
  if (session) {
359
359
  userPasskeys = await ctx.context.adapter.findMany({
@@ -407,7 +407,7 @@ const passkey = (options) => {
407
407
  });
408
408
  }
409
409
  ),
410
- verifyPasskeyRegistration: account.createAuthEndpoint(
410
+ verifyPasskeyRegistration: refreshToken.createAuthEndpoint(
411
411
  "/passkey/verify-registration",
412
412
  {
413
413
  method: "POST",
@@ -419,7 +419,7 @@ const passkey = (options) => {
419
419
  description: "Name of the passkey"
420
420
  }).optional()
421
421
  }),
422
- use: [account.freshSessionMiddleware],
422
+ use: [refreshToken.freshSessionMiddleware],
423
423
  metadata: {
424
424
  openapi: {
425
425
  description: "Verify registration of a new passkey",
@@ -528,7 +528,7 @@ const passkey = (options) => {
528
528
  }
529
529
  }
530
530
  ),
531
- verifyPasskeyAuthentication: account.createAuthEndpoint(
531
+ verifyPasskeyAuthentication: refreshToken.createAuthEndpoint(
532
532
  "/passkey/verify-authentication",
533
533
  {
534
534
  method: "POST",
@@ -679,11 +679,11 @@ const passkey = (options) => {
679
679
  }
680
680
  }
681
681
  ),
682
- listPasskeys: account.createAuthEndpoint(
682
+ listPasskeys: refreshToken.createAuthEndpoint(
683
683
  "/passkey/list-user-passkeys",
684
684
  {
685
685
  method: "GET",
686
- use: [account.sessionMiddleware]
686
+ use: [refreshToken.sessionMiddleware]
687
687
  },
688
688
  async (ctx) => {
689
689
  const passkeys = await ctx.context.adapter.findMany({
@@ -695,14 +695,14 @@ const passkey = (options) => {
695
695
  });
696
696
  }
697
697
  ),
698
- deletePasskey: account.createAuthEndpoint(
698
+ deletePasskey: refreshToken.createAuthEndpoint(
699
699
  "/passkey/delete-passkey",
700
700
  {
701
701
  method: "POST",
702
702
  body: zod.z.object({
703
703
  id: zod.z.string()
704
704
  }),
705
- use: [account.sessionMiddleware]
705
+ use: [refreshToken.sessionMiddleware]
706
706
  },
707
707
  async (ctx) => {
708
708
  await ctx.context.adapter.delete({
@@ -719,7 +719,7 @@ const passkey = (options) => {
719
719
  });
720
720
  }
721
721
  ),
722
- updatePasskey: account.createAuthEndpoint(
722
+ updatePasskey: refreshToken.createAuthEndpoint(
723
723
  "/passkey/update-passkey",
724
724
  {
725
725
  method: "POST",
@@ -727,7 +727,7 @@ const passkey = (options) => {
727
727
  id: zod.z.string(),
728
728
  name: zod.z.string()
729
729
  }),
730
- use: [account.sessionMiddleware]
730
+ use: [refreshToken.sessionMiddleware]
731
731
  },
732
732
  async (ctx) => {
733
733
  const passkey2 = await ctx.context.adapter.findOne({
@@ -2,11 +2,11 @@ import * as _simplewebauthn_server from '@simplewebauthn/server';
2
2
  import { CredentialDeviceType, PublicKeyCredentialCreationOptionsJSON, AuthenticationResponseJSON } from '@simplewebauthn/server';
3
3
  import * as better_call from 'better-call';
4
4
  import { z } from 'zod';
5
- import { I as InferOptionSchema } from '../../shared/better-auth.CxMUffeh.cjs';
5
+ import { I as InferOptionSchema } from '../../shared/better-auth.BDAwKjlL.cjs';
6
6
  import '../../shared/better-auth.Bi8FQwDD.cjs';
7
- import 'kysely';
8
- import '../../shared/better-auth.CzK7QJBv.cjs';
7
+ import '../../shared/better-auth.CH6fRG6d.cjs';
9
8
  import 'jose';
9
+ import 'kysely';
10
10
  import 'better-sqlite3';
11
11
 
12
12
  interface PasskeyOptions {
@@ -2,11 +2,11 @@ import * as _simplewebauthn_server from '@simplewebauthn/server';
2
2
  import { CredentialDeviceType, PublicKeyCredentialCreationOptionsJSON, AuthenticationResponseJSON } from '@simplewebauthn/server';
3
3
  import * as better_call from 'better-call';
4
4
  import { z } from 'zod';
5
- import { I as InferOptionSchema } from '../../shared/better-auth.dzwyqpra.mjs';
5
+ import { I as InferOptionSchema } from '../../shared/better-auth.CTQDLJN7.mjs';
6
6
  import '../../shared/better-auth.Bi8FQwDD.mjs';
7
- import 'kysely';
8
- import '../../shared/better-auth.BjoUuJNr.mjs';
7
+ import '../../shared/better-auth.BTnAiI8e.mjs';
9
8
  import 'jose';
9
+ import 'kysely';
10
10
  import 'better-sqlite3';
11
11
 
12
12
  interface PasskeyOptions {
@@ -2,11 +2,11 @@ import * as _simplewebauthn_server from '@simplewebauthn/server';
2
2
  import { CredentialDeviceType, PublicKeyCredentialCreationOptionsJSON, AuthenticationResponseJSON } from '@simplewebauthn/server';
3
3
  import * as better_call from 'better-call';
4
4
  import { z } from 'zod';
5
- import { I as InferOptionSchema } from '../../shared/better-auth.CixnJ90x.js';
5
+ import { I as InferOptionSchema } from '../../shared/better-auth.tpz8D0AA.js';
6
6
  import '../../shared/better-auth.Bi8FQwDD.js';
7
- import 'kysely';
8
- import '../../shared/better-auth.Dd96RDNl.js';
7
+ import '../../shared/better-auth.BAfIsot3.js';
9
8
  import 'jose';
9
+ import 'kysely';
10
10
  import 'better-sqlite3';
11
11
 
12
12
  interface PasskeyOptions {
@@ -2,7 +2,7 @@ import { verifyAuthenticationResponse, verifyRegistrationResponse, generateAuthe
2
2
  import { APIError } from 'better-call';
3
3
  import { g as generateRandomString } from '../../shared/better-auth.B4Qoxdgc.mjs';
4
4
  import { z } from 'zod';
5
- import { a as createAuthEndpoint, s as sessionMiddleware, f as freshSessionMiddleware, g as getSessionFromCtx } from '../../shared/better-auth.ybwxmbrM.mjs';
5
+ import { a as createAuthEndpoint, s as sessionMiddleware, f as freshSessionMiddleware, g as getSessionFromCtx } from '../../shared/better-auth.DQ-pFMwp.mjs';
6
6
  import { setSessionCookie } from '../../cookies/index.mjs';
7
7
  import { m as mergeSchema } from '../../shared/better-auth.CepcSj5H.mjs';
8
8
  import '../../shared/better-auth.8zoxzg-F.mjs';
@@ -22,7 +22,7 @@ import '@noble/hashes/utils';
22
22
  import '@better-auth/utils/random';
23
23
  import '../../social-providers/index.mjs';
24
24
  import '@better-fetch/fetch';
25
- import '../../shared/better-auth.DiMBK1Ep.mjs';
25
+ import '../../shared/better-auth.B2THyVQH.mjs';
26
26
  import '../../shared/better-auth.CW6D9eSx.mjs';
27
27
  import '../../shared/better-auth.DdzSJf-n.mjs';
28
28
  import '../../shared/better-auth.BdyOG_p4.mjs';
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  const zod = require('zod');
4
- const account = require('../../shared/better-auth.4J4_zAGP.cjs');
4
+ const refreshToken = require('../../shared/better-auth.b0MLzqQX.cjs');
5
5
  const betterCall = require('better-call');
6
6
  const schema$1 = require('../../shared/better-auth.C5H9XEzZ.cjs');
7
7
  const random = require('../../shared/better-auth.CYeOI8C-.cjs');
@@ -13,7 +13,7 @@ const date = require('../../shared/better-auth.C1hdVENX.cjs');
13
13
  require('../../social-providers/index.cjs');
14
14
  require('@better-fetch/fetch');
15
15
  require('jose');
16
- require('../../shared/better-auth.DgXCgiHI.cjs');
16
+ require('../../shared/better-auth.BLV8UOn8.cjs');
17
17
  require('@better-auth/utils/hash');
18
18
  require('@better-auth/utils/base64');
19
19
  require('@noble/ciphers/chacha');
@@ -59,7 +59,7 @@ const phoneNumber = (options) => {
59
59
  return {
60
60
  id: "phone-number",
61
61
  endpoints: {
62
- signInPhoneNumber: account.createAuthEndpoint(
62
+ signInPhoneNumber: refreshToken.createAuthEndpoint(
63
63
  "/sign-in/phone-number",
64
64
  {
65
65
  method: "POST",
@@ -167,7 +167,7 @@ const phoneNumber = (options) => {
167
167
  if (!session) {
168
168
  ctx.context.logger.error("Failed to create session");
169
169
  throw new betterCall.APIError("UNAUTHORIZED", {
170
- message: account.BASE_ERROR_CODES.FAILED_TO_CREATE_SESSION
170
+ message: refreshToken.BASE_ERROR_CODES.FAILED_TO_CREATE_SESSION
171
171
  });
172
172
  }
173
173
  await cookies_index.setSessionCookie(
@@ -194,7 +194,7 @@ const phoneNumber = (options) => {
194
194
  });
195
195
  }
196
196
  ),
197
- sendPhoneNumberOTP: account.createAuthEndpoint(
197
+ sendPhoneNumberOTP: refreshToken.createAuthEndpoint(
198
198
  "/phone-number/send-otp",
199
199
  {
200
200
  method: "POST",
@@ -260,7 +260,7 @@ const phoneNumber = (options) => {
260
260
  return ctx.json({ message: "code sent" });
261
261
  }
262
262
  ),
263
- verifyPhoneNumber: account.createAuthEndpoint(
263
+ verifyPhoneNumber: refreshToken.createAuthEndpoint(
264
264
  "/phone-number/verify",
265
265
  {
266
266
  method: "POST",
@@ -344,10 +344,10 @@ const phoneNumber = (options) => {
344
344
  }
345
345
  await ctx.context.internalAdapter.deleteVerificationValue(otp.id);
346
346
  if (ctx.body.updatePhoneNumber) {
347
- const session = await account.getSessionFromCtx(ctx);
347
+ const session = await refreshToken.getSessionFromCtx(ctx);
348
348
  if (!session) {
349
349
  throw new betterCall.APIError("UNAUTHORIZED", {
350
- message: account.BASE_ERROR_CODES.USER_NOT_FOUND
350
+ message: refreshToken.BASE_ERROR_CODES.USER_NOT_FOUND
351
351
  });
352
352
  }
353
353
  const existingUser = await ctx.context.adapter.findMany({
@@ -414,7 +414,7 @@ const phoneNumber = (options) => {
414
414
  );
415
415
  if (!user) {
416
416
  throw new betterCall.APIError("INTERNAL_SERVER_ERROR", {
417
- message: account.BASE_ERROR_CODES.FAILED_TO_CREATE_USER
417
+ message: refreshToken.BASE_ERROR_CODES.FAILED_TO_CREATE_USER
418
418
  });
419
419
  }
420
420
  }
@@ -439,7 +439,7 @@ const phoneNumber = (options) => {
439
439
  );
440
440
  if (!user) {
441
441
  throw new betterCall.APIError("INTERNAL_SERVER_ERROR", {
442
- message: account.BASE_ERROR_CODES.FAILED_TO_UPDATE_USER
442
+ message: refreshToken.BASE_ERROR_CODES.FAILED_TO_UPDATE_USER
443
443
  });
444
444
  }
445
445
  if (!ctx.body.disableSession) {
@@ -449,7 +449,7 @@ const phoneNumber = (options) => {
449
449
  );
450
450
  if (!session) {
451
451
  throw new betterCall.APIError("INTERNAL_SERVER_ERROR", {
452
- message: account.BASE_ERROR_CODES.FAILED_TO_CREATE_SESSION
452
+ message: refreshToken.BASE_ERROR_CODES.FAILED_TO_CREATE_SESSION
453
453
  });
454
454
  }
455
455
  await cookies_index.setSessionCookie(ctx, {
@@ -489,7 +489,7 @@ const phoneNumber = (options) => {
489
489
  });
490
490
  }
491
491
  ),
492
- forgetPasswordPhoneNumber: account.createAuthEndpoint(
492
+ forgetPasswordPhoneNumber: refreshToken.createAuthEndpoint(
493
493
  "/phone-number/forget-password",
494
494
  {
495
495
  method: "POST",
@@ -530,7 +530,7 @@ const phoneNumber = (options) => {
530
530
  });
531
531
  }
532
532
  ),
533
- resetPasswordPhoneNumber: account.createAuthEndpoint(
533
+ resetPasswordPhoneNumber: refreshToken.createAuthEndpoint(
534
534
  "/phone-number/reset-password",
535
535
  {
536
536
  method: "POST",
@@ -1,10 +1,10 @@
1
1
  import * as better_call from 'better-call';
2
2
  import { z } from 'zod';
3
- import { U as User, I as InferOptionSchema } from '../../shared/better-auth.CxMUffeh.cjs';
3
+ import { U as User, I as InferOptionSchema } from '../../shared/better-auth.BDAwKjlL.cjs';
4
4
  import '../../shared/better-auth.Bi8FQwDD.cjs';
5
- import 'kysely';
6
- import '../../shared/better-auth.CzK7QJBv.cjs';
5
+ import '../../shared/better-auth.CH6fRG6d.cjs';
7
6
  import 'jose';
7
+ import 'kysely';
8
8
  import 'better-sqlite3';
9
9
 
10
10
  interface UserWithPhoneNumber extends User {
@@ -1,10 +1,10 @@
1
1
  import * as better_call from 'better-call';
2
2
  import { z } from 'zod';
3
- import { U as User, I as InferOptionSchema } from '../../shared/better-auth.dzwyqpra.mjs';
3
+ import { U as User, I as InferOptionSchema } from '../../shared/better-auth.CTQDLJN7.mjs';
4
4
  import '../../shared/better-auth.Bi8FQwDD.mjs';
5
- import 'kysely';
6
- import '../../shared/better-auth.BjoUuJNr.mjs';
5
+ import '../../shared/better-auth.BTnAiI8e.mjs';
7
6
  import 'jose';
7
+ import 'kysely';
8
8
  import 'better-sqlite3';
9
9
 
10
10
  interface UserWithPhoneNumber extends User {
@@ -1,10 +1,10 @@
1
1
  import * as better_call from 'better-call';
2
2
  import { z } from 'zod';
3
- import { U as User, I as InferOptionSchema } from '../../shared/better-auth.CixnJ90x.js';
3
+ import { U as User, I as InferOptionSchema } from '../../shared/better-auth.tpz8D0AA.js';
4
4
  import '../../shared/better-auth.Bi8FQwDD.js';
5
- import 'kysely';
6
- import '../../shared/better-auth.Dd96RDNl.js';
5
+ import '../../shared/better-auth.BAfIsot3.js';
7
6
  import 'jose';
7
+ import 'kysely';
8
8
  import 'better-sqlite3';
9
9
 
10
10
  interface UserWithPhoneNumber extends User {
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { a as createAuthEndpoint, g as getSessionFromCtx, B as BASE_ERROR_CODES } from '../../shared/better-auth.ybwxmbrM.mjs';
2
+ import { a as createAuthEndpoint, g as getSessionFromCtx, B as BASE_ERROR_CODES } from '../../shared/better-auth.DQ-pFMwp.mjs';
3
3
  import { APIError } from 'better-call';
4
4
  import { m as mergeSchema } from '../../shared/better-auth.CepcSj5H.mjs';
5
5
  import { g as generateRandomString } from '../../shared/better-auth.B4Qoxdgc.mjs';
@@ -11,7 +11,7 @@ import { g as getDate } from '../../shared/better-auth.CW6D9eSx.mjs';
11
11
  import '../../social-providers/index.mjs';
12
12
  import '@better-fetch/fetch';
13
13
  import 'jose';
14
- import '../../shared/better-auth.DiMBK1Ep.mjs';
14
+ import '../../shared/better-auth.B2THyVQH.mjs';
15
15
  import '@better-auth/utils/hash';
16
16
  import '@better-auth/utils/base64';
17
17
  import '@noble/ciphers/chacha';
@@ -2,17 +2,17 @@
2
2
 
3
3
  const zod = require('zod');
4
4
  const betterCall = require('better-call');
5
- const account = require('../../shared/better-auth.4J4_zAGP.cjs');
5
+ const refreshToken = require('../../shared/better-auth.b0MLzqQX.cjs');
6
6
  const cookies_index = require('../../cookies/index.cjs');
7
7
  require('../../shared/better-auth.C5H9XEzZ.cjs');
8
8
  require('../../shared/better-auth.DiSjtgs9.cjs');
9
9
  require('../../shared/better-auth.GpOOav9x.cjs');
10
10
  require('defu');
11
- const validateAuthorizationCode = require('../../shared/better-auth.DgXCgiHI.cjs');
11
+ const refreshAccessToken = require('../../shared/better-auth.BLV8UOn8.cjs');
12
+ const fetch = require('@better-fetch/fetch');
12
13
  require('@better-auth/utils/hash');
13
14
  require('@better-auth/utils/base64');
14
15
  const state = require('../../shared/better-auth.QbbyHMYf.cjs');
15
- const fetch = require('@better-fetch/fetch');
16
16
  const jose = require('jose');
17
17
  require('../../social-providers/index.cjs');
18
18
  require('@noble/ciphers/chacha');
@@ -38,7 +38,7 @@ const sso = (options) => {
38
38
  return {
39
39
  id: "sso",
40
40
  endpoints: {
41
- createOIDCProvider: account.createAuthEndpoint(
41
+ createOIDCProvider: refreshToken.createAuthEndpoint(
42
42
  "/sso/register",
43
43
  {
44
44
  method: "POST",
@@ -100,7 +100,7 @@ const sso = (options) => {
100
100
  description: "If organization plugin is enabled, the organization id to link the provider to"
101
101
  }).optional()
102
102
  }),
103
- use: [account.sessionMiddleware],
103
+ use: [refreshToken.sessionMiddleware],
104
104
  metadata: {
105
105
  openapi: {
106
106
  summary: "Register an OIDC provider",
@@ -152,7 +152,7 @@ const sso = (options) => {
152
152
  });
153
153
  }
154
154
  ),
155
- signInSSO: account.createAuthEndpoint(
155
+ signInSSO: refreshToken.createAuthEndpoint(
156
156
  "/sign-in/sso",
157
157
  {
158
158
  method: "POST",
@@ -278,7 +278,7 @@ const sso = (options) => {
278
278
  }
279
279
  const state$1 = await state.generateState(ctx);
280
280
  const redirectURI = `${ctx.context.baseURL}/sso/callback/${provider.providerId}`;
281
- const authorizationURL = await validateAuthorizationCode.createAuthorizationURL({
281
+ const authorizationURL = await refreshAccessToken.createAuthorizationURL({
282
282
  id: provider.issuer,
283
283
  options: {
284
284
  clientId: provider.oidcConfig.clientId,
@@ -301,7 +301,7 @@ const sso = (options) => {
301
301
  });
302
302
  }
303
303
  ),
304
- callbackSSO: account.createAuthEndpoint(
304
+ callbackSSO: refreshToken.createAuthEndpoint(
305
305
  "/sso/callback/:providerId",
306
306
  {
307
307
  method: "GET",
@@ -376,7 +376,7 @@ const sso = (options) => {
376
376
  `${errorURL || callbackURL}/error?error=invalid_provider&error_description=token_endpoint_not_found`
377
377
  );
378
378
  }
379
- const tokenResponse = await validateAuthorizationCode.validateAuthorizationCode({
379
+ const tokenResponse = await refreshAccessToken.validateAuthorizationCode({
380
380
  code,
381
381
  codeVerifier: provider.oidcConfig.pkce ? stateData.codeVerifier : void 0,
382
382
  redirectURI: `${ctx.context.baseURL}/sso/callback/${provider.providerId}`,
@@ -407,7 +407,7 @@ const sso = (options) => {
407
407
  `${errorURL || callbackURL}/error?error=invalid_provider&error_description=jwks_endpoint_not_found`
408
408
  );
409
409
  }
410
- const verified = await validateAuthorizationCode.validateToken(
410
+ const verified = await refreshAccessToken.validateToken(
411
411
  tokenResponse.idToken,
412
412
  config.jwksEndpoint
413
413
  ).catch((e) => {
@@ -461,7 +461,7 @@ const sso = (options) => {
461
461
  `${errorURL || callbackURL}/error?error=invalid_provider&error_description=missing_user_info`
462
462
  );
463
463
  }
464
- const linked = await account.handleOAuthUserInfo(ctx, {
464
+ const linked = await refreshToken.handleOAuthUserInfo(ctx, {
465
465
  userInfo: {
466
466
  email: userInfo.email,
467
467
  name: userInfo.name || userInfo.email,
@@ -1,7 +1,7 @@
1
1
  import * as better_call from 'better-call';
2
2
  import { z } from 'zod';
3
- import { O as OAuth2Tokens } from '../../shared/better-auth.CzK7QJBv.cjs';
4
- import { U as User } from '../../shared/better-auth.CxMUffeh.cjs';
3
+ import { O as OAuth2Tokens } from '../../shared/better-auth.CH6fRG6d.cjs';
4
+ import { U as User } from '../../shared/better-auth.BDAwKjlL.cjs';
5
5
  import '../../shared/better-auth.Bi8FQwDD.cjs';
6
6
  import 'jose';
7
7
  import 'kysely';
@@ -1,7 +1,7 @@
1
1
  import * as better_call from 'better-call';
2
2
  import { z } from 'zod';
3
- import { O as OAuth2Tokens } from '../../shared/better-auth.BjoUuJNr.mjs';
4
- import { U as User } from '../../shared/better-auth.dzwyqpra.mjs';
3
+ import { O as OAuth2Tokens } from '../../shared/better-auth.BTnAiI8e.mjs';
4
+ import { U as User } from '../../shared/better-auth.CTQDLJN7.mjs';
5
5
  import '../../shared/better-auth.Bi8FQwDD.mjs';
6
6
  import 'jose';
7
7
  import 'kysely';
@@ -1,7 +1,7 @@
1
1
  import * as better_call from 'better-call';
2
2
  import { z } from 'zod';
3
- import { O as OAuth2Tokens } from '../../shared/better-auth.Dd96RDNl.js';
4
- import { U as User } from '../../shared/better-auth.CixnJ90x.js';
3
+ import { O as OAuth2Tokens } from '../../shared/better-auth.BAfIsot3.js';
4
+ import { U as User } from '../../shared/better-auth.tpz8D0AA.js';
5
5
  import '../../shared/better-auth.Bi8FQwDD.js';
6
6
  import 'jose';
7
7
  import 'kysely';
@@ -1,16 +1,16 @@
1
1
  import { z } from 'zod';
2
2
  import { APIError } from 'better-call';
3
- import { a as createAuthEndpoint, h as handleOAuthUserInfo, s as sessionMiddleware } from '../../shared/better-auth.ybwxmbrM.mjs';
3
+ import { a as createAuthEndpoint, h as handleOAuthUserInfo, s as sessionMiddleware } from '../../shared/better-auth.DQ-pFMwp.mjs';
4
4
  import { setSessionCookie } from '../../cookies/index.mjs';
5
5
  import '../../shared/better-auth.CepcSj5H.mjs';
6
6
  import '../../shared/better-auth.8zoxzg-F.mjs';
7
7
  import '../../shared/better-auth.DH3YjMQH.mjs';
8
8
  import 'defu';
9
- import { v as validateAuthorizationCode, a as validateToken, c as createAuthorizationURL } from '../../shared/better-auth.DiMBK1Ep.mjs';
9
+ import { v as validateAuthorizationCode, a as validateToken, c as createAuthorizationURL } from '../../shared/better-auth.B2THyVQH.mjs';
10
+ import { betterFetch, BetterFetchError } from '@better-fetch/fetch';
10
11
  import '@better-auth/utils/hash';
11
12
  import '@better-auth/utils/base64';
12
13
  import { p as parseState, g as generateState } from '../../shared/better-auth.BdyOG_p4.mjs';
13
- import { betterFetch, BetterFetchError } from '@better-fetch/fetch';
14
14
  import { decodeJwt } from 'jose';
15
15
  import '../../social-providers/index.mjs';
16
16
  import '@noble/ciphers/chacha';