better-auth 0.5.3 → 0.5.4-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.
package/dist/.DS_Store CHANGED
Binary file
@@ -1,4 +1,4 @@
1
- import { A as Adapter } from '../auth-BCBgLbpW.js';
1
+ import { A as Adapter } from '../auth-CTqbQewg.js';
2
2
  import 'zod';
3
3
  import 'kysely';
4
4
  import '../schema-Dkt0LqYs.js';
@@ -1,5 +1,5 @@
1
1
  import { Kysely } from 'kysely';
2
- import { B as BetterAuthOptions, K as KyselyDatabaseType, F as FieldAttribute, A as Adapter } from '../auth-BCBgLbpW.js';
2
+ import { B as BetterAuthOptions, K as KyselyDatabaseType, F as FieldAttribute, A as Adapter } from '../auth-CTqbQewg.js';
3
3
  import 'zod';
4
4
  import '../schema-Dkt0LqYs.js';
5
5
  import 'better-call';
@@ -1,5 +1,5 @@
1
1
  import { Db } from 'mongodb';
2
- import { W as Where } from '../auth-BCBgLbpW.js';
2
+ import { W as Where } from '../auth-CTqbQewg.js';
3
3
  import 'zod';
4
4
  import 'kysely';
5
5
  import '../schema-Dkt0LqYs.js';
@@ -1,4 +1,4 @@
1
- import { A as Adapter } from '../auth-BCBgLbpW.js';
1
+ import { A as Adapter } from '../auth-CTqbQewg.js';
2
2
  import 'zod';
3
3
  import 'kysely';
4
4
  import '../schema-Dkt0LqYs.js';
package/dist/api.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { e as AuthEndpoint, f as AuthMiddleware, a1 as callbackOAuth, aj as changeEmail, ag as changePassword, d as createAuthEndpoint, c as createAuthMiddleware, ac as createEmailVerificationToken, ao as csrfMiddleware, ai as deleteUser, al as error, a9 as forgetPassword, aa as forgetPasswordCallback, ak as getCSRFToken, Z as getEndpoints, a2 as getSession, a3 as getSessionFromCtx, a5 as listSessions, am as ok, o as optionsMiddleware, ab as resetPassword, a6 as revokeSession, a7 as revokeSessions, _ as router, ad as sendVerificationEmail, a4 as sessionMiddleware, ah as setPassword, a0 as signInEmail, $ as signInOAuth, a8 as signOut, an as signUpEmail, af as updateUser, ae as verifyEmail } from './auth-BCBgLbpW.js';
1
+ export { e as AuthEndpoint, f as AuthMiddleware, a1 as callbackOAuth, aj as changeEmail, ag as changePassword, d as createAuthEndpoint, c as createAuthMiddleware, ac as createEmailVerificationToken, ao as csrfMiddleware, ai as deleteUser, al as error, a9 as forgetPassword, aa as forgetPasswordCallback, ak as getCSRFToken, Z as getEndpoints, a2 as getSession, a3 as getSessionFromCtx, a5 as listSessions, am as ok, o as optionsMiddleware, ab as resetPassword, a6 as revokeSession, a7 as revokeSessions, _ as router, ad as sendVerificationEmail, a4 as sessionMiddleware, ah as setPassword, a0 as signInEmail, $ as signInOAuth, a8 as signOut, an as signUpEmail, af as updateUser, ae as verifyEmail } from './auth-CTqbQewg.js';
2
2
  import './helper-DPDj8Nix.js';
3
3
  export { APIError } from 'better-call';
4
4
  import 'zod';
@@ -1251,12 +1251,12 @@ declare const signInOAuth: {
1251
1251
  /**
1252
1252
  * OAuth2 provider to use`
1253
1253
  */
1254
- provider: z.ZodEnum<["github", ...("apple" | "discord" | "facebook" | "github" | "google" | "microsoft" | "spotify" | "twitch" | "twitter" | "dropbox" | "linkedin")[]]>;
1254
+ provider: z.ZodEnum<["github", ...("github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter" | "dropbox" | "linkedin")[]]>;
1255
1255
  }, "strip", z.ZodTypeAny, {
1256
- provider: "apple" | "discord" | "facebook" | "github" | "google" | "microsoft" | "spotify" | "twitch" | "twitter" | "dropbox" | "linkedin";
1256
+ provider: "github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter" | "dropbox" | "linkedin";
1257
1257
  callbackURL?: string | undefined;
1258
1258
  }, {
1259
- provider: "apple" | "discord" | "facebook" | "github" | "google" | "microsoft" | "spotify" | "twitch" | "twitter" | "dropbox" | "linkedin";
1259
+ provider: "github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter" | "dropbox" | "linkedin";
1260
1260
  callbackURL?: string | undefined;
1261
1261
  }>;
1262
1262
  use: better_call.Endpoint<better_call.Handler<string, better_call.EndpointOptions, void>, better_call.EndpointOptions>[];
@@ -1294,12 +1294,12 @@ declare const signInOAuth: {
1294
1294
  /**
1295
1295
  * OAuth2 provider to use`
1296
1296
  */
1297
- provider: z.ZodEnum<["github", ...("apple" | "discord" | "facebook" | "github" | "google" | "microsoft" | "spotify" | "twitch" | "twitter" | "dropbox" | "linkedin")[]]>;
1297
+ provider: z.ZodEnum<["github", ...("github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter" | "dropbox" | "linkedin")[]]>;
1298
1298
  }, "strip", z.ZodTypeAny, {
1299
- provider: "apple" | "discord" | "facebook" | "github" | "google" | "microsoft" | "spotify" | "twitch" | "twitter" | "dropbox" | "linkedin";
1299
+ provider: "github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter" | "dropbox" | "linkedin";
1300
1300
  callbackURL?: string | undefined;
1301
1301
  }, {
1302
- provider: "apple" | "discord" | "facebook" | "github" | "google" | "microsoft" | "spotify" | "twitch" | "twitter" | "dropbox" | "linkedin";
1302
+ provider: "github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter" | "dropbox" | "linkedin";
1303
1303
  callbackURL?: string | undefined;
1304
1304
  }>;
1305
1305
  use: better_call.Endpoint<better_call.Handler<string, better_call.EndpointOptions, void>, better_call.EndpointOptions>[];
@@ -2604,12 +2604,12 @@ declare function getEndpoints<C extends AuthContext, Option extends BetterAuthOp
2604
2604
  }>>;
2605
2605
  body: zod.ZodObject<{
2606
2606
  callbackURL: zod.ZodOptional<zod.ZodString>;
2607
- provider: zod.ZodEnum<["github", ...("apple" | "discord" | "facebook" | "github" | "google" | "microsoft" | "spotify" | "twitch" | "twitter" | "dropbox" | "linkedin")[]]>;
2607
+ provider: zod.ZodEnum<["github", ...("github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter" | "dropbox" | "linkedin")[]]>;
2608
2608
  }, "strip", zod.ZodTypeAny, {
2609
- provider: "apple" | "discord" | "facebook" | "github" | "google" | "microsoft" | "spotify" | "twitch" | "twitter" | "dropbox" | "linkedin";
2609
+ provider: "github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter" | "dropbox" | "linkedin";
2610
2610
  callbackURL?: string | undefined;
2611
2611
  }, {
2612
- provider: "apple" | "discord" | "facebook" | "github" | "google" | "microsoft" | "spotify" | "twitch" | "twitter" | "dropbox" | "linkedin";
2612
+ provider: "github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter" | "dropbox" | "linkedin";
2613
2613
  callbackURL?: string | undefined;
2614
2614
  }>;
2615
2615
  use: Endpoint<better_call.Handler<string, better_call.EndpointOptions, void>, better_call.EndpointOptions>[];
@@ -2637,12 +2637,12 @@ declare function getEndpoints<C extends AuthContext, Option extends BetterAuthOp
2637
2637
  }>>;
2638
2638
  body: zod.ZodObject<{
2639
2639
  callbackURL: zod.ZodOptional<zod.ZodString>;
2640
- provider: zod.ZodEnum<["github", ...("apple" | "discord" | "facebook" | "github" | "google" | "microsoft" | "spotify" | "twitch" | "twitter" | "dropbox" | "linkedin")[]]>;
2640
+ provider: zod.ZodEnum<["github", ...("github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter" | "dropbox" | "linkedin")[]]>;
2641
2641
  }, "strip", zod.ZodTypeAny, {
2642
- provider: "apple" | "discord" | "facebook" | "github" | "google" | "microsoft" | "spotify" | "twitch" | "twitter" | "dropbox" | "linkedin";
2642
+ provider: "github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter" | "dropbox" | "linkedin";
2643
2643
  callbackURL?: string | undefined;
2644
2644
  }, {
2645
- provider: "apple" | "discord" | "facebook" | "github" | "google" | "microsoft" | "spotify" | "twitch" | "twitter" | "dropbox" | "linkedin";
2645
+ provider: "github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter" | "dropbox" | "linkedin";
2646
2646
  callbackURL?: string | undefined;
2647
2647
  }>;
2648
2648
  use: Endpoint<better_call.Handler<string, better_call.EndpointOptions, void>, better_call.EndpointOptions>[];
@@ -3879,12 +3879,12 @@ declare const router: <C extends AuthContext, Option extends BetterAuthOptions>(
3879
3879
  }>>;
3880
3880
  body: zod.ZodObject<{
3881
3881
  callbackURL: zod.ZodOptional<zod.ZodString>;
3882
- provider: zod.ZodEnum<["github", ...("apple" | "discord" | "facebook" | "github" | "google" | "microsoft" | "spotify" | "twitch" | "twitter" | "dropbox" | "linkedin")[]]>;
3882
+ provider: zod.ZodEnum<["github", ...("github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter" | "dropbox" | "linkedin")[]]>;
3883
3883
  }, "strip", zod.ZodTypeAny, {
3884
- provider: "apple" | "discord" | "facebook" | "github" | "google" | "microsoft" | "spotify" | "twitch" | "twitter" | "dropbox" | "linkedin";
3884
+ provider: "github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter" | "dropbox" | "linkedin";
3885
3885
  callbackURL?: string | undefined;
3886
3886
  }, {
3887
- provider: "apple" | "discord" | "facebook" | "github" | "google" | "microsoft" | "spotify" | "twitch" | "twitter" | "dropbox" | "linkedin";
3887
+ provider: "github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter" | "dropbox" | "linkedin";
3888
3888
  callbackURL?: string | undefined;
3889
3889
  }>;
3890
3890
  use: Endpoint<better_call.Handler<string, better_call.EndpointOptions, void>, better_call.EndpointOptions>[];
@@ -3912,12 +3912,12 @@ declare const router: <C extends AuthContext, Option extends BetterAuthOptions>(
3912
3912
  }>>;
3913
3913
  body: zod.ZodObject<{
3914
3914
  callbackURL: zod.ZodOptional<zod.ZodString>;
3915
- provider: zod.ZodEnum<["github", ...("apple" | "discord" | "facebook" | "github" | "google" | "microsoft" | "spotify" | "twitch" | "twitter" | "dropbox" | "linkedin")[]]>;
3915
+ provider: zod.ZodEnum<["github", ...("github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter" | "dropbox" | "linkedin")[]]>;
3916
3916
  }, "strip", zod.ZodTypeAny, {
3917
- provider: "apple" | "discord" | "facebook" | "github" | "google" | "microsoft" | "spotify" | "twitch" | "twitter" | "dropbox" | "linkedin";
3917
+ provider: "github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter" | "dropbox" | "linkedin";
3918
3918
  callbackURL?: string | undefined;
3919
3919
  }, {
3920
- provider: "apple" | "discord" | "facebook" | "github" | "google" | "microsoft" | "spotify" | "twitch" | "twitter" | "dropbox" | "linkedin";
3920
+ provider: "github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter" | "dropbox" | "linkedin";
3921
3921
  callbackURL?: string | undefined;
3922
3922
  }>;
3923
3923
  use: Endpoint<better_call.Handler<string, better_call.EndpointOptions, void>, better_call.EndpointOptions>[];
@@ -5156,12 +5156,12 @@ declare const betterAuth: <O extends BetterAuthOptions>(options: O) => {
5156
5156
  }>>;
5157
5157
  body: zod.ZodObject<{
5158
5158
  callbackURL: zod.ZodOptional<zod.ZodString>;
5159
- provider: zod.ZodEnum<["github", ...("apple" | "discord" | "facebook" | "github" | "google" | "microsoft" | "spotify" | "twitch" | "twitter" | "dropbox" | "linkedin")[]]>;
5159
+ provider: zod.ZodEnum<["github", ...("github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter" | "dropbox" | "linkedin")[]]>;
5160
5160
  }, "strip", zod.ZodTypeAny, {
5161
- provider: "apple" | "discord" | "facebook" | "github" | "google" | "microsoft" | "spotify" | "twitch" | "twitter" | "dropbox" | "linkedin";
5161
+ provider: "github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter" | "dropbox" | "linkedin";
5162
5162
  callbackURL?: string | undefined;
5163
5163
  }, {
5164
- provider: "apple" | "discord" | "facebook" | "github" | "google" | "microsoft" | "spotify" | "twitch" | "twitter" | "dropbox" | "linkedin";
5164
+ provider: "github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter" | "dropbox" | "linkedin";
5165
5165
  callbackURL?: string | undefined;
5166
5166
  }>;
5167
5167
  use: Endpoint<better_call.Handler<string, better_call.EndpointOptions, void>, better_call.EndpointOptions>[];
@@ -5189,12 +5189,12 @@ declare const betterAuth: <O extends BetterAuthOptions>(options: O) => {
5189
5189
  }>>;
5190
5190
  body: zod.ZodObject<{
5191
5191
  callbackURL: zod.ZodOptional<zod.ZodString>;
5192
- provider: zod.ZodEnum<["github", ...("apple" | "discord" | "facebook" | "github" | "google" | "microsoft" | "spotify" | "twitch" | "twitter" | "dropbox" | "linkedin")[]]>;
5192
+ provider: zod.ZodEnum<["github", ...("github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter" | "dropbox" | "linkedin")[]]>;
5193
5193
  }, "strip", zod.ZodTypeAny, {
5194
- provider: "apple" | "discord" | "facebook" | "github" | "google" | "microsoft" | "spotify" | "twitch" | "twitter" | "dropbox" | "linkedin";
5194
+ provider: "github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter" | "dropbox" | "linkedin";
5195
5195
  callbackURL?: string | undefined;
5196
5196
  }, {
5197
- provider: "apple" | "discord" | "facebook" | "github" | "google" | "microsoft" | "spotify" | "twitch" | "twitter" | "dropbox" | "linkedin";
5197
+ provider: "github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter" | "dropbox" | "linkedin";
5198
5198
  callbackURL?: string | undefined;
5199
5199
  }>;
5200
5200
  use: Endpoint<better_call.Handler<string, better_call.EndpointOptions, void>, better_call.EndpointOptions>[];
@@ -2,10 +2,10 @@ import * as nanostores from 'nanostores';
2
2
  import { A as AccessControl, S as StatementsPrimitive, R as Role } from '../statement-CfnyN34h.js';
3
3
  import * as _better_fetch_fetch from '@better-fetch/fetch';
4
4
  import { BetterFetchOption } from '@better-fetch/fetch';
5
- import { o as organization, l as Organization, M as Member, I as Invitation, u as username, m as magicLink, d as phoneNumber, e as anonymous, i as admin, j as genericOAuth, k as multiSession } from '../index-CdRT9HUy.js';
6
- export { g as getPasskeyActions, c as passkeyClient, a as twoFactorClient } from '../index-CdRT9HUy.js';
5
+ import { o as organization, l as Organization, M as Member, I as Invitation, u as username, m as magicLink, d as phoneNumber, e as anonymous, i as admin, j as genericOAuth, k as multiSession } from '../index-CwDRn_LS.js';
6
+ export { g as getPasskeyActions, c as passkeyClient, a as twoFactorClient } from '../index-CwDRn_LS.js';
7
7
  import { P as Prettify } from '../helper-DPDj8Nix.js';
8
- import { F as FieldAttribute, B as BetterAuthOptions, b as BetterAuthPlugin } from '../auth-BCBgLbpW.js';
8
+ import { F as FieldAttribute, B as BetterAuthOptions, b as BetterAuthPlugin } from '../auth-CTqbQewg.js';
9
9
  import 'zod';
10
10
  import '../schema-Dkt0LqYs.js';
11
11
  import 'better-call';
package/dist/client.d.ts CHANGED
@@ -6,7 +6,7 @@ import { BetterFetch, BetterFetchError, BetterFetchOption } from '@better-fetch/
6
6
  import { U as UnionToIntersection, P as Prettify, S as StripEmptyObjects } from './helper-DPDj8Nix.js';
7
7
  import { ClientOptions, InferClientAPI, InferActions, InferAdditionalFromClient, InferSessionFromClient, InferUserFromClient, BetterAuthClientPlugin, IsSignal } from './types.js';
8
8
  export { AtomListener, InferPluginsFromClient } from './types.js';
9
- import './auth-BCBgLbpW.js';
9
+ import './auth-CTqbQewg.js';
10
10
  import 'kysely';
11
11
  import './schema-Dkt0LqYs.js';
12
12
  import 'better-call';
@@ -106,18 +106,7 @@ declare function createAuthClient<Option extends ClientOptions>(options?: Option
106
106
  params?: any;
107
107
  duplex?: ("full" | "half") | undefined;
108
108
  jsonParser?: (<T>(text: string) => Promise<T | undefined>) | undefined;
109
- retry?: (number | {
110
- type: "linear";
111
- attempts: number;
112
- delay: number;
113
- shouldRetry?: (response: Response | null) => boolean | Promise<boolean>;
114
- } | {
115
- type: "exponential";
116
- attempts: number;
117
- baseDelay: number;
118
- maxDelay: number;
119
- shouldRetry?: (response: Response | null) => boolean | Promise<boolean>;
120
- }) | undefined;
109
+ retry?: _better_fetch_fetch.RetryOptions | undefined;
121
110
  retryAttempt?: number | undefined;
122
111
  output?: (zod.ZodType | typeof Blob | typeof File) | undefined;
123
112
  errorSchema?: zod.ZodType | undefined;
@@ -172,18 +161,7 @@ declare function createAuthClient<Option extends ClientOptions>(options?: Option
172
161
  params?: any;
173
162
  duplex?: ("full" | "half") | undefined;
174
163
  jsonParser?: (<T>(text: string) => Promise<T | undefined>) | undefined;
175
- retry?: (number | {
176
- type: "linear";
177
- attempts: number;
178
- delay: number;
179
- shouldRetry?: (response: Response | null) => boolean | Promise<boolean>;
180
- } | {
181
- type: "exponential";
182
- attempts: number;
183
- baseDelay: number;
184
- maxDelay: number;
185
- shouldRetry?: (response: Response | null) => boolean | Promise<boolean>;
186
- }) | undefined;
164
+ retry?: _better_fetch_fetch.RetryOptions | undefined;
187
165
  retryAttempt?: number | undefined;
188
166
  output?: (zod.ZodType | typeof Blob | typeof File) | undefined;
189
167
  errorSchema?: zod.ZodType | undefined;
@@ -237,18 +215,7 @@ declare function createAuthClient<Option extends ClientOptions>(options?: Option
237
215
  params?: any;
238
216
  duplex?: "full" | "half";
239
217
  jsonParser?: <T>(text: string) => Promise<T | undefined>;
240
- retry?: number | {
241
- type: "linear";
242
- attempts: number;
243
- delay: number;
244
- shouldRetry?: (response: Response | null) => boolean | Promise<boolean>;
245
- } | {
246
- type: "exponential";
247
- attempts: number;
248
- baseDelay: number;
249
- maxDelay: number;
250
- shouldRetry?: (response: Response | null) => boolean | Promise<boolean>;
251
- };
218
+ retry?: _better_fetch_fetch.RetryOptions;
252
219
  retryAttempt?: number;
253
220
  output?: zod.ZodType | typeof Blob | typeof File;
254
221
  errorSchema?: zod.ZodType;
package/dist/cookies.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import 'better-call';
2
- export { s as BetterAuthCookies, E as EligibleCookies, r as createCookieGetter, u as deleteSessionCookie, q as getCookies, w as parseCookies, v as parseSetCookieHeader, t as setSessionCookie } from './auth-BCBgLbpW.js';
2
+ export { s as BetterAuthCookies, E as EligibleCookies, r as createCookieGetter, u as deleteSessionCookie, q as getCookies, w as parseCookies, v as parseSetCookieHeader, t as setSessionCookie } from './auth-CTqbQewg.js';
3
3
  import 'zod';
4
4
  import 'kysely';
5
5
  import './schema-Dkt0LqYs.js';
package/dist/db.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { A as Adapter, B as BetterAuthOptions, W as Where, F as FieldAttribute, z as FieldType, K as KyselyDatabaseType } from './auth-BCBgLbpW.js';
2
- export { X as BetterAuthDbSchema, J as FieldAttributeConfig, V as InferFieldsFromOptions, U as InferFieldsFromPlugins, O as InferFieldsInput, Q as InferFieldsInputClient, N as InferFieldsOutput, M as InferValueType, D as InternalAdapter, T as PluginFieldAttribute, L as createFieldAttribute, C as createInternalAdapter, Y as getAuthTables } from './auth-BCBgLbpW.js';
1
+ import { A as Adapter, B as BetterAuthOptions, W as Where, F as FieldAttribute, z as FieldType, K as KyselyDatabaseType } from './auth-CTqbQewg.js';
2
+ export { X as BetterAuthDbSchema, J as FieldAttributeConfig, V as InferFieldsFromOptions, U as InferFieldsFromPlugins, O as InferFieldsInput, Q as InferFieldsInputClient, N as InferFieldsOutput, M as InferValueType, D as InternalAdapter, T as PluginFieldAttribute, L as createFieldAttribute, C as createInternalAdapter, Y as getAuthTables } from './auth-CTqbQewg.js';
3
3
  import { z } from 'zod';
4
4
  import 'kysely';
5
5
  import './schema-Dkt0LqYs.js';
@@ -5,7 +5,7 @@ import { P as Prettify } from './helper-DPDj8Nix.js';
5
5
  import { A as AccessControl, R as Role, S as StatementsPrimitive, g as defaultRoles } from './statement-CfnyN34h.js';
6
6
  import * as _better_fetch_fetch from '@better-fetch/fetch';
7
7
  import { BetterFetch, BetterFetchOption } from '@better-fetch/fetch';
8
- import { H as HookEndpointContext, p as AuthContext } from './auth-BCBgLbpW.js';
8
+ import { H as HookEndpointContext, p as AuthContext } from './auth-CTqbQewg.js';
9
9
  import * as nanostores from 'nanostores';
10
10
  import { atom } from 'nanostores';
11
11
  import * as _simplewebauthn_types from '@simplewebauthn/types';
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { A as Adapter, j as AdditionalSessionFieldsInput, k as AdditionalSessionFieldsOutput, h as AdditionalUserFieldsInput, i as AdditionalUserFieldsOutput, a as Auth, p as AuthContext, s as BetterAuthCookies, B as BetterAuthOptions, b as BetterAuthPlugin, E as EligibleCookies, G as GenericEndpointContext, H as HookEndpointContext, m as InferPluginTypes, l as InferSession, I as InferUser, P as PluginSchema, R as RateLimit, S as SecondaryStorage, W as Where, g as betterAuth, r as createCookieGetter, x as createLogger, u as deleteSessionCookie, q as getCookies, n as init, y as logger, w as parseCookies, v as parseSetCookieHeader, t as setSessionCookie } from './auth-BCBgLbpW.js';
1
+ export { A as Adapter, j as AdditionalSessionFieldsInput, k as AdditionalSessionFieldsOutput, h as AdditionalUserFieldsInput, i as AdditionalUserFieldsOutput, a as Auth, p as AuthContext, s as BetterAuthCookies, B as BetterAuthOptions, b as BetterAuthPlugin, E as EligibleCookies, G as GenericEndpointContext, H as HookEndpointContext, m as InferPluginTypes, l as InferSession, I as InferUser, P as PluginSchema, R as RateLimit, S as SecondaryStorage, W as Where, g as betterAuth, r as createCookieGetter, x as createLogger, u as deleteSessionCookie, q as getCookies, n as init, y as logger, w as parseCookies, v as parseSetCookieHeader, t as setSessionCookie } from './auth-CTqbQewg.js';
2
2
  export { D as DeepPartial, H as HasRequiredKeys, L as LiteralString, a as LiteralUnion, P as Prettify, R as RequiredKeysOf, S as StripEmptyObjects, U as UnionToIntersection, W as WithoutEmpty } from './helper-DPDj8Nix.js';
3
3
  export { AtomListener, BetterAuthClientPlugin, ClientOptions, InferActions, InferAdditionalFromClient, InferClientAPI, InferPluginsFromClient, InferSessionFromClient, InferUserFromClient, IsSignal } from './types.js';
4
4
  export { H as HIDE_METADATA } from './hide-metadata-DEHJp1rk.js';
package/dist/node.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as http from 'http';
2
2
  import { IncomingHttpHeaders } from 'http';
3
- import { a as Auth } from './auth-BCBgLbpW.js';
3
+ import { a as Auth } from './auth-CTqbQewg.js';
4
4
  import 'zod';
5
5
  import 'kysely';
6
6
  import './schema-Dkt0LqYs.js';
package/dist/plugins.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- export { A as AnonymousOptions, O as OrganizationOptions, b as Passkey, P as PasskeyOptions, U as UserWithPhoneNumber, f as UserWithRole, i as admin, h as adminMiddleware, e as anonymous, j as genericOAuth, g as getPasskeyActions, m as magicLink, k as multiSession, o as organization, p as passkey, c as passkeyClient, d as phoneNumber, t as twoFactor, a as twoFactorClient, u as username } from './index-CdRT9HUy.js';
1
+ export { A as AnonymousOptions, O as OrganizationOptions, b as Passkey, P as PasskeyOptions, U as UserWithPhoneNumber, f as UserWithRole, i as admin, h as adminMiddleware, e as anonymous, j as genericOAuth, g as getPasskeyActions, m as magicLink, k as multiSession, o as organization, p as passkey, c as passkeyClient, d as phoneNumber, t as twoFactor, a as twoFactorClient, u as username } from './index-CwDRn_LS.js';
2
2
  export { i as ac } from './index-DfAHOgpj.js';
3
- import { H as HookEndpointContext, P as PluginSchema } from './auth-BCBgLbpW.js';
4
- export { e as AuthEndpoint, f as AuthMiddleware, b as BetterAuthPlugin, d as createAuthEndpoint, c as createAuthMiddleware, o as optionsMiddleware } from './auth-BCBgLbpW.js';
3
+ import { H as HookEndpointContext, P as PluginSchema } from './auth-CTqbQewg.js';
4
+ export { e as AuthEndpoint, f as AuthMiddleware, b as BetterAuthPlugin, d as createAuthEndpoint, c as createAuthMiddleware, o as optionsMiddleware } from './auth-CTqbQewg.js';
5
5
  export { H as HIDE_METADATA } from './hide-metadata-DEHJp1rk.js';
6
6
  import { U as User } from './schema-Dkt0LqYs.js';
7
7
  import * as better_call from 'better-call';
package/dist/react.d.ts CHANGED
@@ -3,7 +3,7 @@ import * as _better_fetch_fetch from '@better-fetch/fetch';
3
3
  import { U as UnionToIntersection, P as Prettify, S as StripEmptyObjects } from './helper-DPDj8Nix.js';
4
4
  import { ClientOptions, InferClientAPI, InferActions, InferAdditionalFromClient, BetterAuthClientPlugin, IsSignal } from './types.js';
5
5
  import { useStore } from '@nanostores/react';
6
- import './auth-BCBgLbpW.js';
6
+ import './auth-CTqbQewg.js';
7
7
  import 'kysely';
8
8
  import './schema-Dkt0LqYs.js';
9
9
  import 'better-call';
@@ -130,18 +130,7 @@ declare function createAuthClient<Option extends ClientOptions>(options?: Option
130
130
  params?: any;
131
131
  duplex?: ("full" | "half") | undefined;
132
132
  jsonParser?: (<T>(text: string) => Promise<T | undefined>) | undefined;
133
- retry?: (number | {
134
- type: "linear";
135
- attempts: number;
136
- delay: number;
137
- shouldRetry?: (response: Response | null) => boolean | Promise<boolean>;
138
- } | {
139
- type: "exponential";
140
- attempts: number;
141
- baseDelay: number;
142
- maxDelay: number;
143
- shouldRetry?: (response: Response | null) => boolean | Promise<boolean>;
144
- }) | undefined;
133
+ retry?: _better_fetch_fetch.RetryOptions | undefined;
145
134
  retryAttempt?: number | undefined;
146
135
  output?: (zod.ZodType | typeof Blob | typeof File) | undefined;
147
136
  errorSchema?: zod.ZodType | undefined;
@@ -196,18 +185,7 @@ declare function createAuthClient<Option extends ClientOptions>(options?: Option
196
185
  params?: any;
197
186
  duplex?: ("full" | "half") | undefined;
198
187
  jsonParser?: (<T>(text: string) => Promise<T | undefined>) | undefined;
199
- retry?: (number | {
200
- type: "linear";
201
- attempts: number;
202
- delay: number;
203
- shouldRetry?: (response: Response | null) => boolean | Promise<boolean>;
204
- } | {
205
- type: "exponential";
206
- attempts: number;
207
- baseDelay: number;
208
- maxDelay: number;
209
- shouldRetry?: (response: Response | null) => boolean | Promise<boolean>;
210
- }) | undefined;
188
+ retry?: _better_fetch_fetch.RetryOptions | undefined;
211
189
  retryAttempt?: number | undefined;
212
190
  output?: (zod.ZodType | typeof Blob | typeof File) | undefined;
213
191
  errorSchema?: zod.ZodType | undefined;
@@ -273,18 +251,7 @@ declare function createAuthClient<Option extends ClientOptions>(options?: Option
273
251
  params?: any;
274
252
  duplex?: "full" | "half";
275
253
  jsonParser?: <T>(text: string) => Promise<T | undefined>;
276
- retry?: number | {
277
- type: "linear";
278
- attempts: number;
279
- delay: number;
280
- shouldRetry?: (response: Response | null) => boolean | Promise<boolean>;
281
- } | {
282
- type: "exponential";
283
- attempts: number;
284
- baseDelay: number;
285
- maxDelay: number;
286
- shouldRetry?: (response: Response | null) => boolean | Promise<boolean>;
287
- };
254
+ retry?: _better_fetch_fetch.RetryOptions;
288
255
  retryAttempt?: number;
289
256
  output?: zod.ZodType | typeof Blob | typeof File;
290
257
  errorSchema?: zod.ZodType;
@@ -1,4 +1,4 @@
1
- import { a as Auth } from './auth-BCBgLbpW.js';
1
+ import { a as Auth } from './auth-CTqbQewg.js';
2
2
  import 'zod';
3
3
  import 'kysely';
4
4
  import './schema-Dkt0LqYs.js';
package/dist/solid.d.ts CHANGED
@@ -3,7 +3,7 @@ import * as _better_fetch_fetch from '@better-fetch/fetch';
3
3
  import { U as UnionToIntersection, P as Prettify, S as StripEmptyObjects } from './helper-DPDj8Nix.js';
4
4
  import { ClientOptions, InferClientAPI, InferActions, InferAdditionalFromClient, BetterAuthClientPlugin, IsSignal } from './types.js';
5
5
  import { Accessor } from 'solid-js';
6
- import './auth-BCBgLbpW.js';
6
+ import './auth-CTqbQewg.js';
7
7
  import 'kysely';
8
8
  import './schema-Dkt0LqYs.js';
9
9
  import 'better-call';
@@ -112,18 +112,7 @@ declare function createAuthClient<Option extends ClientOptions>(options?: Option
112
112
  params?: any;
113
113
  duplex?: ("full" | "half") | undefined;
114
114
  jsonParser?: (<T>(text: string) => Promise<T | undefined>) | undefined;
115
- retry?: (number | {
116
- type: "linear";
117
- attempts: number;
118
- delay: number;
119
- shouldRetry?: (response: Response | null) => boolean | Promise<boolean>;
120
- } | {
121
- type: "exponential";
122
- attempts: number;
123
- baseDelay: number;
124
- maxDelay: number;
125
- shouldRetry?: (response: Response | null) => boolean | Promise<boolean>;
126
- }) | undefined;
115
+ retry?: _better_fetch_fetch.RetryOptions | undefined;
127
116
  retryAttempt?: number | undefined;
128
117
  output?: (zod.ZodType | typeof Blob | typeof File) | undefined;
129
118
  errorSchema?: zod.ZodType | undefined;
@@ -178,18 +167,7 @@ declare function createAuthClient<Option extends ClientOptions>(options?: Option
178
167
  params?: any;
179
168
  duplex?: ("full" | "half") | undefined;
180
169
  jsonParser?: (<T>(text: string) => Promise<T | undefined>) | undefined;
181
- retry?: (number | {
182
- type: "linear";
183
- attempts: number;
184
- delay: number;
185
- shouldRetry?: (response: Response | null) => boolean | Promise<boolean>;
186
- } | {
187
- type: "exponential";
188
- attempts: number;
189
- baseDelay: number;
190
- maxDelay: number;
191
- shouldRetry?: (response: Response | null) => boolean | Promise<boolean>;
192
- }) | undefined;
170
+ retry?: _better_fetch_fetch.RetryOptions | undefined;
193
171
  retryAttempt?: number | undefined;
194
172
  output?: (zod.ZodType | typeof Blob | typeof File) | undefined;
195
173
  errorSchema?: zod.ZodType | undefined;
@@ -255,18 +233,7 @@ declare function createAuthClient<Option extends ClientOptions>(options?: Option
255
233
  params?: any;
256
234
  duplex?: "full" | "half";
257
235
  jsonParser?: <T>(text: string) => Promise<T | undefined>;
258
- retry?: number | {
259
- type: "linear";
260
- attempts: number;
261
- delay: number;
262
- shouldRetry?: (response: Response | null) => boolean | Promise<boolean>;
263
- } | {
264
- type: "exponential";
265
- attempts: number;
266
- baseDelay: number;
267
- maxDelay: number;
268
- shouldRetry?: (response: Response | null) => boolean | Promise<boolean>;
269
- };
236
+ retry?: _better_fetch_fetch.RetryOptions;
270
237
  retryAttempt?: number;
271
238
  output?: zod.ZodType | typeof Blob | typeof File;
272
239
  errorSchema?: zod.ZodType;
@@ -1,4 +1,4 @@
1
- import { a as Auth, B as BetterAuthOptions } from './auth-BCBgLbpW.js';
1
+ import { a as Auth, B as BetterAuthOptions } from './auth-CTqbQewg.js';
2
2
  import 'zod';
3
3
  import 'kysely';
4
4
  import './schema-Dkt0LqYs.js';
package/dist/svelte.d.ts CHANGED
@@ -3,7 +3,7 @@ import * as nanostores from 'nanostores';
3
3
  import * as _better_fetch_fetch from '@better-fetch/fetch';
4
4
  import { U as UnionToIntersection, P as Prettify, S as StripEmptyObjects } from './helper-DPDj8Nix.js';
5
5
  import { ClientOptions, InferClientAPI, InferActions, InferAdditionalFromClient, BetterAuthClientPlugin, IsSignal } from './types.js';
6
- import './auth-BCBgLbpW.js';
6
+ import './auth-CTqbQewg.js';
7
7
  import 'kysely';
8
8
  import './schema-Dkt0LqYs.js';
9
9
  import 'better-call';
@@ -111,18 +111,7 @@ declare function createAuthClient<Option extends ClientOptions>(options?: Option
111
111
  params?: any;
112
112
  duplex?: ("full" | "half") | undefined;
113
113
  jsonParser?: (<T>(text: string) => Promise<T | undefined>) | undefined;
114
- retry?: (number | {
115
- type: "linear";
116
- attempts: number;
117
- delay: number;
118
- shouldRetry?: (response: Response | null) => boolean | Promise<boolean>;
119
- } | {
120
- type: "exponential";
121
- attempts: number;
122
- baseDelay: number;
123
- maxDelay: number;
124
- shouldRetry?: (response: Response | null) => boolean | Promise<boolean>;
125
- }) | undefined;
114
+ retry?: _better_fetch_fetch.RetryOptions | undefined;
126
115
  retryAttempt?: number | undefined;
127
116
  output?: (zod.ZodType | typeof Blob | typeof File) | undefined;
128
117
  errorSchema?: zod.ZodType | undefined;
@@ -177,18 +166,7 @@ declare function createAuthClient<Option extends ClientOptions>(options?: Option
177
166
  params?: any;
178
167
  duplex?: ("full" | "half") | undefined;
179
168
  jsonParser?: (<T>(text: string) => Promise<T | undefined>) | undefined;
180
- retry?: (number | {
181
- type: "linear";
182
- attempts: number;
183
- delay: number;
184
- shouldRetry?: (response: Response | null) => boolean | Promise<boolean>;
185
- } | {
186
- type: "exponential";
187
- attempts: number;
188
- baseDelay: number;
189
- maxDelay: number;
190
- shouldRetry?: (response: Response | null) => boolean | Promise<boolean>;
191
- }) | undefined;
169
+ retry?: _better_fetch_fetch.RetryOptions | undefined;
192
170
  retryAttempt?: number | undefined;
193
171
  output?: (zod.ZodType | typeof Blob | typeof File) | undefined;
194
172
  errorSchema?: zod.ZodType | undefined;
@@ -254,18 +232,7 @@ declare function createAuthClient<Option extends ClientOptions>(options?: Option
254
232
  params?: any;
255
233
  duplex?: "full" | "half";
256
234
  jsonParser?: <T>(text: string) => Promise<T | undefined>;
257
- retry?: number | {
258
- type: "linear";
259
- attempts: number;
260
- delay: number;
261
- shouldRetry?: (response: Response | null) => boolean | Promise<boolean>;
262
- } | {
263
- type: "exponential";
264
- attempts: number;
265
- baseDelay: number;
266
- maxDelay: number;
267
- shouldRetry?: (response: Response | null) => boolean | Promise<boolean>;
268
- };
235
+ retry?: _better_fetch_fetch.RetryOptions;
269
236
  retryAttempt?: number;
270
237
  output?: zod.ZodType | typeof Blob | typeof File;
271
238
  errorSchema?: zod.ZodType;
package/dist/types.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { b as BetterAuthPlugin, a as Auth, Q as InferFieldsInputClient, N as InferFieldsOutput } from './auth-BCBgLbpW.js';
2
- export { A as Adapter, j as AdditionalSessionFieldsInput, k as AdditionalSessionFieldsOutput, h as AdditionalUserFieldsInput, i as AdditionalUserFieldsOutput, p as AuthContext, B as BetterAuthOptions, G as GenericEndpointContext, H as HookEndpointContext, m as InferPluginTypes, l as InferSession, I as InferUser, P as PluginSchema, R as RateLimit, S as SecondaryStorage, W as Where, n as init } from './auth-BCBgLbpW.js';
1
+ import { b as BetterAuthPlugin, a as Auth, Q as InferFieldsInputClient, N as InferFieldsOutput } from './auth-CTqbQewg.js';
2
+ export { A as Adapter, j as AdditionalSessionFieldsInput, k as AdditionalSessionFieldsOutput, h as AdditionalUserFieldsInput, i as AdditionalUserFieldsOutput, p as AuthContext, B as BetterAuthOptions, G as GenericEndpointContext, H as HookEndpointContext, m as InferPluginTypes, l as InferSession, I as InferUser, P as PluginSchema, R as RateLimit, S as SecondaryStorage, W as Where, n as init } from './auth-CTqbQewg.js';
3
3
  import { U as UnionToIntersection, H as HasRequiredKeys, P as Prettify, S as StripEmptyObjects, L as LiteralString } from './helper-DPDj8Nix.js';
4
4
  export { D as DeepPartial, a as LiteralUnion, R as RequiredKeysOf, W as WithoutEmpty } from './helper-DPDj8Nix.js';
5
5
  import { BetterFetchOption, BetterFetchResponse, BetterFetch, BetterFetchPlugin } from '@better-fetch/fetch';
package/dist/vue.d.ts CHANGED
@@ -3,7 +3,7 @@ import * as _better_fetch_fetch from '@better-fetch/fetch';
3
3
  import { U as UnionToIntersection, P as Prettify, S as StripEmptyObjects } from './helper-DPDj8Nix.js';
4
4
  import { ClientOptions, InferClientAPI, InferActions, InferAdditionalFromClient, BetterAuthClientPlugin, IsSignal } from './types.js';
5
5
  import { Ref, DeepReadonly } from 'vue';
6
- import './auth-BCBgLbpW.js';
6
+ import './auth-CTqbQewg.js';
7
7
  import 'kysely';
8
8
  import './schema-Dkt0LqYs.js';
9
9
  import 'better-call';
@@ -162,18 +162,7 @@ declare function createAuthClient<Option extends ClientOptions>(options?: Option
162
162
  params?: any;
163
163
  duplex?: ("full" | "half") | undefined;
164
164
  jsonParser?: (<T>(text: string) => Promise<T | undefined>) | undefined;
165
- retry?: (number | {
166
- type: "linear";
167
- attempts: number;
168
- delay: number;
169
- shouldRetry?: (response: Response | null) => boolean | Promise<boolean>;
170
- } | {
171
- type: "exponential";
172
- attempts: number;
173
- baseDelay: number;
174
- maxDelay: number;
175
- shouldRetry?: (response: Response | null) => boolean | Promise<boolean>;
176
- }) | undefined;
165
+ retry?: _better_fetch_fetch.RetryOptions | undefined;
177
166
  retryAttempt?: number | undefined;
178
167
  output?: (zod.ZodType | typeof Blob | typeof File) | undefined;
179
168
  errorSchema?: zod.ZodType | undefined;
@@ -228,18 +217,7 @@ declare function createAuthClient<Option extends ClientOptions>(options?: Option
228
217
  params?: any;
229
218
  duplex?: ("full" | "half") | undefined;
230
219
  jsonParser?: (<T>(text: string) => Promise<T | undefined>) | undefined;
231
- retry?: (number | {
232
- type: "linear";
233
- attempts: number;
234
- delay: number;
235
- shouldRetry?: (response: Response | null) => boolean | Promise<boolean>;
236
- } | {
237
- type: "exponential";
238
- attempts: number;
239
- baseDelay: number;
240
- maxDelay: number;
241
- shouldRetry?: (response: Response | null) => boolean | Promise<boolean>;
242
- }) | undefined;
220
+ retry?: _better_fetch_fetch.RetryOptions | undefined;
243
221
  retryAttempt?: number | undefined;
244
222
  output?: (zod.ZodType | typeof Blob | typeof File) | undefined;
245
223
  errorSchema?: zod.ZodType | undefined;
@@ -305,18 +283,7 @@ declare function createAuthClient<Option extends ClientOptions>(options?: Option
305
283
  params?: any;
306
284
  duplex?: "full" | "half";
307
285
  jsonParser?: <T>(text: string) => Promise<T | undefined>;
308
- retry?: number | {
309
- type: "linear";
310
- attempts: number;
311
- delay: number;
312
- shouldRetry?: (response: Response | null) => boolean | Promise<boolean>;
313
- } | {
314
- type: "exponential";
315
- attempts: number;
316
- baseDelay: number;
317
- maxDelay: number;
318
- shouldRetry?: (response: Response | null) => boolean | Promise<boolean>;
319
- };
286
+ retry?: _better_fetch_fetch.RetryOptions;
320
287
  retryAttempt?: number;
321
288
  output?: zod.ZodType | typeof Blob | typeof File;
322
289
  errorSchema?: zod.ZodType;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "better-auth",
3
- "version": "0.5.3",
3
+ "version": "0.5.4-beta.1",
4
4
  "description": "The most comprehensive authentication library for TypeScript.",
5
5
  "type": "module",
6
6
  "repository": {
@@ -204,7 +204,7 @@
204
204
  "vue": "^3.5.0"
205
205
  },
206
206
  "dependencies": {
207
- "@better-fetch/fetch": "^1.1.9",
207
+ "@better-fetch/fetch": "1.1.12",
208
208
  "@nanostores/query": "^0.3.4",
209
209
  "@nanostores/react": "^0.7.3",
210
210
  "@nanostores/solid": "^0.4.2",