better-auth 0.4.8 → 0.4.9-beta.2

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.
@@ -1,4 +1,4 @@
1
- import { A as Adapter } from '../index-CPq0wKn7.js';
1
+ import { A as Adapter } from '../index-DA3DGLb0.js';
2
2
  import 'zod';
3
3
  import 'kysely';
4
4
  import '../types-IzAbV4nB.js';
@@ -1,5 +1,5 @@
1
1
  import { Db } from 'mongodb';
2
- import { W as Where } from '../index-CPq0wKn7.js';
2
+ import { W as Where } from '../index-DA3DGLb0.js';
3
3
  import 'zod';
4
4
  import 'kysely';
5
5
  import '../types-IzAbV4nB.js';
@@ -1,4 +1,4 @@
1
- import { A as Adapter } from '../index-CPq0wKn7.js';
1
+ import { A as Adapter } from '../index-DA3DGLb0.js';
2
2
  import 'zod';
3
3
  import 'kysely';
4
4
  import '../types-IzAbV4nB.js';
package/dist/api.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { e as AuthEndpoint, f as AuthMiddleware, v as callbackOAuth, T as changePassword, d as createAuthEndpoint, c as createAuthMiddleware, M as createEmailVerificationToken, $ as csrfMiddleware, V as deleteUser, Y as error, J as forgetPassword, K as forgetPasswordCallback, X as getCSRFToken, r as getEndpoints, w as getSession, x as getSessionFromCtx, z as listSessions, Z as ok, o as optionsMiddleware, L as resetPassword, C as revokeSession, D as revokeSessions, s as router, N as sendVerificationEmail, y as sessionMiddleware, U as setPassword, u as signInEmail, t as signInOAuth, E as signOut, _ as signUpEmail, Q as updateUser, O as verifyEmail } from './index-CPq0wKn7.js';
1
+ export { e as AuthEndpoint, f as AuthMiddleware, v as callbackOAuth, T as changePassword, d as createAuthEndpoint, c as createAuthMiddleware, M as createEmailVerificationToken, $ as csrfMiddleware, V as deleteUser, Y as error, J as forgetPassword, K as forgetPasswordCallback, X as getCSRFToken, r as getEndpoints, w as getSession, x as getSessionFromCtx, z as listSessions, Z as ok, o as optionsMiddleware, L as resetPassword, C as revokeSession, D as revokeSessions, s as router, N as sendVerificationEmail, y as sessionMiddleware, U as setPassword, u as signInEmail, t as signInOAuth, E as signOut, _ as signUpEmail, Q as updateUser, O as verifyEmail } from './index-DA3DGLb0.js';
2
2
  import './helper-DPDj8Nix.js';
3
3
  import 'zod';
4
4
  export { APIError } from 'better-call';
package/dist/cli.js CHANGED
@@ -814,7 +814,7 @@ var migrate = new Command("migrate").option(
814
814
  return;
815
815
  }
816
816
  const db = await createKyselyAdapter(config).catch((e) => {
817
- logger.error(e.message);
817
+ logger.error(e);
818
818
  process.exit(1);
819
819
  });
820
820
  if (!db) {
@@ -1288,6 +1288,7 @@ var generate = new Command2("generate").option(
1288
1288
  });
1289
1289
 
1290
1290
  // src/cli/index.ts
1291
+ import "dotenv/config";
1291
1292
  async function main() {
1292
1293
  const program = new Command3().name("better-auth");
1293
1294
  program.addCommand(migrate).addCommand(generate).version("0.0.1").description("Better Auth CLI");
@@ -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, j as Organization, M as Member, I as Invitation, u as username, m as magicLink, d as phoneNumber, e as anonymous, i as admin } from '../index-BL_Wucme.js';
6
- export { g as getPasskeyActions, c as passkeyClient, a as twoFactorClient } from '../index-BL_Wucme.js';
5
+ import { o as organization, j as Organization, M as Member, I as Invitation, u as username, m as magicLink, d as phoneNumber, e as anonymous, i as admin } from '../index-vhlBGsGw.js';
6
+ export { g as getPasskeyActions, c as passkeyClient, a as twoFactorClient } from '../index-vhlBGsGw.js';
7
7
  import { P as Prettify } from '../helper-DPDj8Nix.js';
8
- import { F as FieldAttribute, B as BetterAuthOptions, b as BetterAuthPlugin } from '../index-CPq0wKn7.js';
8
+ import { F as FieldAttribute, B as BetterAuthOptions, b as BetterAuthPlugin } from '../index-DA3DGLb0.js';
9
9
  import * as better_call from 'better-call';
10
10
  import { z } from 'zod';
11
11
  import { O as OAuth2Tokens, U as User } from '../types-IzAbV4nB.js';
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 './index-CPq0wKn7.js';
9
+ import './index-DA3DGLb0.js';
10
10
  import 'kysely';
11
11
  import './types-IzAbV4nB.js';
12
12
  import 'better-call';
@@ -1119,12 +1119,12 @@ declare const signInOAuth: {
1119
1119
  /**
1120
1120
  * OAuth2 provider to use`
1121
1121
  */
1122
- provider: z.ZodEnum<["github", ...("apple" | "discord" | "facebook" | "github" | "google" | "microsoft" | "spotify" | "twitch" | "twitter")[]]>;
1122
+ provider: z.ZodEnum<["github", ...("github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter")[]]>;
1123
1123
  }, "strip", z.ZodTypeAny, {
1124
- provider: "apple" | "discord" | "facebook" | "github" | "google" | "microsoft" | "spotify" | "twitch" | "twitter";
1124
+ provider: "github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter";
1125
1125
  callbackURL?: string | undefined;
1126
1126
  }, {
1127
- provider: "apple" | "discord" | "facebook" | "github" | "google" | "microsoft" | "spotify" | "twitch" | "twitter";
1127
+ provider: "github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter";
1128
1128
  callbackURL?: string | undefined;
1129
1129
  }>;
1130
1130
  }>]>(...ctx: C): Promise<C extends [{
@@ -1158,12 +1158,12 @@ declare const signInOAuth: {
1158
1158
  /**
1159
1159
  * OAuth2 provider to use`
1160
1160
  */
1161
- provider: z.ZodEnum<["github", ...("apple" | "discord" | "facebook" | "github" | "google" | "microsoft" | "spotify" | "twitch" | "twitter")[]]>;
1161
+ provider: z.ZodEnum<["github", ...("github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter")[]]>;
1162
1162
  }, "strip", z.ZodTypeAny, {
1163
- provider: "apple" | "discord" | "facebook" | "github" | "google" | "microsoft" | "spotify" | "twitch" | "twitter";
1163
+ provider: "github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter";
1164
1164
  callbackURL?: string | undefined;
1165
1165
  }, {
1166
- provider: "apple" | "discord" | "facebook" | "github" | "google" | "microsoft" | "spotify" | "twitch" | "twitter";
1166
+ provider: "github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter";
1167
1167
  callbackURL?: string | undefined;
1168
1168
  }>;
1169
1169
  };
@@ -2360,12 +2360,12 @@ declare function getEndpoints<C extends AuthContext, Option extends BetterAuthOp
2360
2360
  }>>;
2361
2361
  body: zod.ZodObject<{
2362
2362
  callbackURL: zod.ZodOptional<zod.ZodString>;
2363
- provider: zod.ZodEnum<["github", ...("apple" | "discord" | "facebook" | "github" | "google" | "microsoft" | "spotify" | "twitch" | "twitter")[]]>;
2363
+ provider: zod.ZodEnum<["github", ...("github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter")[]]>;
2364
2364
  }, "strip", zod.ZodTypeAny, {
2365
- provider: "apple" | "discord" | "facebook" | "github" | "google" | "microsoft" | "spotify" | "twitch" | "twitter";
2365
+ provider: "github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter";
2366
2366
  callbackURL?: string | undefined;
2367
2367
  }, {
2368
- provider: "apple" | "discord" | "facebook" | "github" | "google" | "microsoft" | "spotify" | "twitch" | "twitter";
2368
+ provider: "github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter";
2369
2369
  callbackURL?: string | undefined;
2370
2370
  }>;
2371
2371
  }>]>(...ctx: C_1): Promise<C_1 extends [{
@@ -2389,12 +2389,12 @@ declare function getEndpoints<C extends AuthContext, Option extends BetterAuthOp
2389
2389
  }>>;
2390
2390
  body: zod.ZodObject<{
2391
2391
  callbackURL: zod.ZodOptional<zod.ZodString>;
2392
- provider: zod.ZodEnum<["github", ...("apple" | "discord" | "facebook" | "github" | "google" | "microsoft" | "spotify" | "twitch" | "twitter")[]]>;
2392
+ provider: zod.ZodEnum<["github", ...("github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter")[]]>;
2393
2393
  }, "strip", zod.ZodTypeAny, {
2394
- provider: "apple" | "discord" | "facebook" | "github" | "google" | "microsoft" | "spotify" | "twitch" | "twitter";
2394
+ provider: "github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter";
2395
2395
  callbackURL?: string | undefined;
2396
2396
  }, {
2397
- provider: "apple" | "discord" | "facebook" | "github" | "google" | "microsoft" | "spotify" | "twitch" | "twitter";
2397
+ provider: "github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter";
2398
2398
  callbackURL?: string | undefined;
2399
2399
  }>;
2400
2400
  };
@@ -3449,12 +3449,12 @@ declare const router: <C extends AuthContext, Option extends BetterAuthOptions>(
3449
3449
  }>>;
3450
3450
  body: zod.ZodObject<{
3451
3451
  callbackURL: zod.ZodOptional<zod.ZodString>;
3452
- provider: zod.ZodEnum<["github", ...("apple" | "discord" | "facebook" | "github" | "google" | "microsoft" | "spotify" | "twitch" | "twitter")[]]>;
3452
+ provider: zod.ZodEnum<["github", ...("github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter")[]]>;
3453
3453
  }, "strip", zod.ZodTypeAny, {
3454
- provider: "apple" | "discord" | "facebook" | "github" | "google" | "microsoft" | "spotify" | "twitch" | "twitter";
3454
+ provider: "github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter";
3455
3455
  callbackURL?: string | undefined;
3456
3456
  }, {
3457
- provider: "apple" | "discord" | "facebook" | "github" | "google" | "microsoft" | "spotify" | "twitch" | "twitter";
3457
+ provider: "github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter";
3458
3458
  callbackURL?: string | undefined;
3459
3459
  }>;
3460
3460
  }>]>(...ctx: C_1): Promise<C_1 extends [{
@@ -3478,12 +3478,12 @@ declare const router: <C extends AuthContext, Option extends BetterAuthOptions>(
3478
3478
  }>>;
3479
3479
  body: zod.ZodObject<{
3480
3480
  callbackURL: zod.ZodOptional<zod.ZodString>;
3481
- provider: zod.ZodEnum<["github", ...("apple" | "discord" | "facebook" | "github" | "google" | "microsoft" | "spotify" | "twitch" | "twitter")[]]>;
3481
+ provider: zod.ZodEnum<["github", ...("github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter")[]]>;
3482
3482
  }, "strip", zod.ZodTypeAny, {
3483
- provider: "apple" | "discord" | "facebook" | "github" | "google" | "microsoft" | "spotify" | "twitch" | "twitter";
3483
+ provider: "github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter";
3484
3484
  callbackURL?: string | undefined;
3485
3485
  }, {
3486
- provider: "apple" | "discord" | "facebook" | "github" | "google" | "microsoft" | "spotify" | "twitch" | "twitter";
3486
+ provider: "github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter";
3487
3487
  callbackURL?: string | undefined;
3488
3488
  }>;
3489
3489
  };
@@ -4540,12 +4540,12 @@ declare const betterAuth: <O extends BetterAuthOptions>(options: O) => {
4540
4540
  }>>;
4541
4541
  body: zod.ZodObject<{
4542
4542
  callbackURL: zod.ZodOptional<zod.ZodString>;
4543
- provider: zod.ZodEnum<["github", ...("apple" | "discord" | "facebook" | "github" | "google" | "microsoft" | "spotify" | "twitch" | "twitter")[]]>;
4543
+ provider: zod.ZodEnum<["github", ...("github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter")[]]>;
4544
4544
  }, "strip", zod.ZodTypeAny, {
4545
- provider: "apple" | "discord" | "facebook" | "github" | "google" | "microsoft" | "spotify" | "twitch" | "twitter";
4545
+ provider: "github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter";
4546
4546
  callbackURL?: string | undefined;
4547
4547
  }, {
4548
- provider: "apple" | "discord" | "facebook" | "github" | "google" | "microsoft" | "spotify" | "twitch" | "twitter";
4548
+ provider: "github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter";
4549
4549
  callbackURL?: string | undefined;
4550
4550
  }>;
4551
4551
  }>]>(...ctx: C): Promise<C extends [{
@@ -4569,12 +4569,12 @@ declare const betterAuth: <O extends BetterAuthOptions>(options: O) => {
4569
4569
  }>>;
4570
4570
  body: zod.ZodObject<{
4571
4571
  callbackURL: zod.ZodOptional<zod.ZodString>;
4572
- provider: zod.ZodEnum<["github", ...("apple" | "discord" | "facebook" | "github" | "google" | "microsoft" | "spotify" | "twitch" | "twitter")[]]>;
4572
+ provider: zod.ZodEnum<["github", ...("github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter")[]]>;
4573
4573
  }, "strip", zod.ZodTypeAny, {
4574
- provider: "apple" | "discord" | "facebook" | "github" | "google" | "microsoft" | "spotify" | "twitch" | "twitter";
4574
+ provider: "github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter";
4575
4575
  callbackURL?: string | undefined;
4576
4576
  }, {
4577
- provider: "apple" | "discord" | "facebook" | "github" | "google" | "microsoft" | "spotify" | "twitch" | "twitter";
4577
+ provider: "github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter";
4578
4578
  callbackURL?: string | undefined;
4579
4579
  }>;
4580
4580
  };
@@ -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, g as AuthContext } from './index-CPq0wKn7.js';
8
+ import { H as HookEndpointContext, g as AuthContext } from './index-DA3DGLb0.js';
9
9
  import * as nanostores from 'nanostores';
10
10
  import { atom } from 'nanostores';
11
11
  import * as _simplewebauthn_types from '@simplewebauthn/types';
@@ -4868,7 +4868,16 @@ declare const admin: (options?: AdminOptions) => {
4868
4868
  after: {
4869
4869
  matcher(context: HookEndpointContext): boolean;
4870
4870
  handler: better_call.Endpoint<better_call.Handler<string, better_call.EndpointOptions, {
4871
- response: Response;
4871
+ response: {
4872
+ body: any;
4873
+ status: number;
4874
+ statusText: string;
4875
+ headers: Record<string, string> | undefined;
4876
+ };
4877
+ body: {
4878
+ response: Response;
4879
+ };
4880
+ _flag: "json";
4872
4881
  } | undefined>, better_call.EndpointOptions>;
4873
4882
  }[];
4874
4883
  };
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { a as Auth, a0 as betterAuth } from './index-CPq0wKn7.js';
1
+ export { a as Auth, a0 as betterAuth } from './index-DA3DGLb0.js';
2
2
  import 'zod';
3
3
  import 'kysely';
4
4
  import './types-IzAbV4nB.js';
package/dist/next-js.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { a as Auth } from './index-CPq0wKn7.js';
1
+ import { a as Auth } from './index-DA3DGLb0.js';
2
2
  import { U as User, S as Session } from './types-IzAbV4nB.js';
3
3
  import { NextRequest } from 'next/server';
4
4
  import 'zod';
package/dist/node.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as http from 'http';
2
- import { a as Auth } from './index-CPq0wKn7.js';
2
+ import { a as Auth } from './index-DA3DGLb0.js';
3
3
  import 'zod';
4
4
  import 'kysely';
5
5
  import './types-IzAbV4nB.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, g as getPasskeyActions, m as magicLink, o as organization, p as passkey, c as passkeyClient, d as phoneNumber, t as twoFactor, a as twoFactorClient, u as username } from './index-BL_Wucme.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, g as getPasskeyActions, m as magicLink, o as organization, p as passkey, c as passkeyClient, d as phoneNumber, t as twoFactor, a as twoFactorClient, u as username } from './index-vhlBGsGw.js';
2
2
  export { i as ac } from './index-DfAHOgpj.js';
3
- import { H as HookEndpointContext } from './index-CPq0wKn7.js';
4
- export { e as AuthEndpoint, f as AuthMiddleware, b as BetterAuthPlugin, P as PluginSchema, d as createAuthEndpoint, c as createAuthMiddleware, o as optionsMiddleware } from './index-CPq0wKn7.js';
3
+ import { H as HookEndpointContext } from './index-DA3DGLb0.js';
4
+ export { e as AuthEndpoint, f as AuthMiddleware, b as BetterAuthPlugin, P as PluginSchema, d as createAuthEndpoint, c as createAuthMiddleware, o as optionsMiddleware } from './index-DA3DGLb0.js';
5
5
  import './types-IzAbV4nB.js';
6
6
  import 'zod';
7
7
  import './helper-DPDj8Nix.js';
package/dist/plugins.js CHANGED
@@ -6378,9 +6378,9 @@ var admin = (options) => {
6378
6378
  statusText: "OK",
6379
6379
  headers: returned.headers
6380
6380
  });
6381
- return {
6381
+ return ctx.json({
6382
6382
  response
6383
- };
6383
+ });
6384
6384
  }
6385
6385
  })
6386
6386
  }
@@ -6404,9 +6404,9 @@ var admin = (options) => {
6404
6404
  role: ctx.body.role
6405
6405
  }
6406
6406
  );
6407
- return {
6407
+ return ctx.json({
6408
6408
  user: updatedUser
6409
- };
6409
+ });
6410
6410
  }
6411
6411
  ),
6412
6412
  createUser: createAuthEndpoint(
@@ -6454,9 +6454,9 @@ var admin = (options) => {
6454
6454
  password: hashedPassword,
6455
6455
  userId: user.id
6456
6456
  });
6457
- return {
6457
+ return ctx.json({
6458
6458
  user
6459
- };
6459
+ });
6460
6460
  }
6461
6461
  ),
6462
6462
  listUsers: createAuthEndpoint(
@@ -6480,9 +6480,9 @@ var admin = (options) => {
6480
6480
  direction: ctx.query.sortDirection || "asc"
6481
6481
  } : void 0
6482
6482
  );
6483
- return {
6483
+ return ctx.json({
6484
6484
  users
6485
- };
6485
+ });
6486
6486
  }
6487
6487
  ),
6488
6488
  listUserSessions: createAuthEndpoint(
@@ -6519,9 +6519,9 @@ var admin = (options) => {
6519
6519
  banned: false
6520
6520
  }
6521
6521
  );
6522
- return {
6522
+ return ctx.json({
6523
6523
  user
6524
- };
6524
+ });
6525
6525
  }
6526
6526
  ),
6527
6527
  banUser: createAuthEndpoint(
@@ -6556,9 +6556,9 @@ var admin = (options) => {
6556
6556
  }
6557
6557
  );
6558
6558
  await ctx.context.internalAdapter.deleteSessions(ctx.body.userId);
6559
- return {
6559
+ return ctx.json({
6560
6560
  user
6561
- };
6561
+ });
6562
6562
  }
6563
6563
  ),
6564
6564
  impersonateUser: createAuthEndpoint(
@@ -6595,10 +6595,10 @@ var admin = (options) => {
6595
6595
  });
6596
6596
  }
6597
6597
  await setSessionCookie(ctx, session.id, true);
6598
- return {
6598
+ return ctx.json({
6599
6599
  session,
6600
6600
  user: targetUser
6601
- };
6601
+ });
6602
6602
  }
6603
6603
  ),
6604
6604
  revokeUserSession: createAuthEndpoint(
@@ -6612,9 +6612,9 @@ var admin = (options) => {
6612
6612
  },
6613
6613
  async (ctx) => {
6614
6614
  await ctx.context.internalAdapter.deleteSession(ctx.body.sessionId);
6615
- return {
6615
+ return ctx.json({
6616
6616
  success: true
6617
- };
6617
+ });
6618
6618
  }
6619
6619
  ),
6620
6620
  revokeUserSessions: createAuthEndpoint(
@@ -6628,9 +6628,9 @@ var admin = (options) => {
6628
6628
  },
6629
6629
  async (ctx) => {
6630
6630
  await ctx.context.internalAdapter.deleteSessions(ctx.body.userId);
6631
- return {
6631
+ return ctx.json({
6632
6632
  success: true
6633
- };
6633
+ });
6634
6634
  }
6635
6635
  ),
6636
6636
  removeUser: createAuthEndpoint(
@@ -6644,9 +6644,9 @@ var admin = (options) => {
6644
6644
  },
6645
6645
  async (ctx) => {
6646
6646
  await ctx.context.internalAdapter.deleteUser(ctx.body.userId);
6647
- return {
6647
+ return ctx.json({
6648
6648
  success: true
6649
- };
6649
+ });
6650
6650
  }
6651
6651
  )
6652
6652
  },
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 './index-CPq0wKn7.js';
6
+ import './index-DA3DGLb0.js';
7
7
  import 'kysely';
8
8
  import './types-IzAbV4nB.js';
9
9
  import 'better-call';
@@ -1,4 +1,4 @@
1
- import { a as Auth } from './index-CPq0wKn7.js';
1
+ import { a as Auth } from './index-DA3DGLb0.js';
2
2
  import 'zod';
3
3
  import 'kysely';
4
4
  import './types-IzAbV4nB.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 './index-CPq0wKn7.js';
6
+ import './index-DA3DGLb0.js';
7
7
  import 'kysely';
8
8
  import './types-IzAbV4nB.js';
9
9
  import 'better-call';
@@ -1,4 +1,4 @@
1
- import { a as Auth, B as BetterAuthOptions } from './index-CPq0wKn7.js';
1
+ import { a as Auth, B as BetterAuthOptions } from './index-DA3DGLb0.js';
2
2
  import 'zod';
3
3
  import 'kysely';
4
4
  import './types-IzAbV4nB.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 './index-CPq0wKn7.js';
6
+ import './index-DA3DGLb0.js';
7
7
  import 'kysely';
8
8
  import './types-IzAbV4nB.js';
9
9
  import 'better-call';
package/dist/types.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { b as BetterAuthPlugin, a as Auth, I as InferFieldsInputClient, h as InferFieldsOutput } from './index-CPq0wKn7.js';
2
- export { A as Adapter, k as AdditionalSessionFieldsInput, l as AdditionalSessionFieldsOutput, i as AdditionalUserFieldsInput, j as AdditionalUserFieldsOutput, g as AuthContext, B as BetterAuthOptions, G as GenericEndpointContext, H as HookEndpointContext, p as InferPluginTypes, n as InferSession, m as InferUser, P as PluginSchema, R as RateLimit, S as SecondaryStorage, W as Where, q as init } from './index-CPq0wKn7.js';
1
+ import { b as BetterAuthPlugin, a as Auth, I as InferFieldsInputClient, h as InferFieldsOutput } from './index-DA3DGLb0.js';
2
+ export { A as Adapter, k as AdditionalSessionFieldsInput, l as AdditionalSessionFieldsOutput, i as AdditionalUserFieldsInput, j as AdditionalUserFieldsOutput, g as AuthContext, B as BetterAuthOptions, G as GenericEndpointContext, H as HookEndpointContext, p as InferPluginTypes, n as InferSession, m as InferUser, P as PluginSchema, R as RateLimit, S as SecondaryStorage, W as Where, q as init } from './index-DA3DGLb0.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 { S as Session, U as User } from './types-IzAbV4nB.js';
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 './index-CPq0wKn7.js';
6
+ import './index-DA3DGLb0.js';
7
7
  import 'kysely';
8
8
  import './types-IzAbV4nB.js';
9
9
  import 'better-call';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "better-auth",
3
- "version": "0.4.8",
3
+ "version": "0.4.9-beta.2",
4
4
  "description": "The most comprehensive authentication library for TypeScript.",
5
5
  "type": "module",
6
6
  "repository": {
@@ -88,6 +88,7 @@
88
88
  "commander": "^12.1.0",
89
89
  "consola": "^3.2.3",
90
90
  "defu": "^6.1.4",
91
+ "dotenv": "^16.4.5",
91
92
  "kysely": "^0.27.4",
92
93
  "nanoid": "^5.0.7",
93
94
  "nanostores": "^0.11.2",