better-auth 0.2.3-beta.12 → 0.2.3-beta.14

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 { f as Adapter, W as Where, F as FieldAttribute } from './index-DH-qiFLO.js';
1
+ import { f as Adapter, W as Where, F as FieldAttribute } from './index-gO-yM4kI.js';
2
2
  import { Kysely } from 'kysely';
3
3
  import './index-CE92ti2Z.js';
4
4
  import 'arctic';
package/dist/adapters.js CHANGED
@@ -163,6 +163,7 @@ var BetterAuthError = class extends Error {
163
163
  this.name = "BetterAuthError";
164
164
  this.message = message;
165
165
  this.cause = cause;
166
+ this.stack = "";
166
167
  }
167
168
  };
168
169
  var MissingDependencyError = class extends BetterAuthError {
@@ -382,7 +383,7 @@ var prismaAdapter = ({
382
383
  }
383
384
  });
384
385
  return {
385
- code: schema,
386
+ code: schema.trim() === schemaPrisma.trim() ? "" : schema,
386
387
  fileName: filePath
387
388
  };
388
389
  }
@@ -498,20 +499,10 @@ var drizzleAdapter = (db, options) => {
498
499
  const filePath = file || "./schema.ts";
499
500
  const timestampAndBoolean = databaseType !== "sqlite" ? "timestamp, boolean" : "";
500
501
  const int = databaseType === "mysql" ? "int" : "integer";
501
- let code = "";
502
- const fileExist = existsSync2(filePath);
503
- if (fileExist) {
504
- const file2 = await fs2.readFile(filePath, "utf-8");
505
- if (file2.includes("import")) {
506
- code = file2;
507
- } else {
508
- code = `import { ${databaseType}Table, text, ${int}, ${timestampAndBoolean} } from "drizzle-orm/${databaseType}-core";
509
- `;
510
- }
511
- } else {
512
- code = `import { ${databaseType}Table, text, ${int}, ${timestampAndBoolean} } from "drizzle-orm/${databaseType}-core";
502
+ let code = `import { ${databaseType}Table, text, ${int}, ${timestampAndBoolean} } from "drizzle-orm/${databaseType}-core";
513
503
  `;
514
- }
504
+ const fileExist = existsSync2(filePath);
505
+ let fileContent = await fs2.readFile(filePath, "utf-8");
515
506
  for (const table in tables) {
516
507
  let getType2 = function(name, type) {
517
508
  if (type === "string") {
@@ -551,6 +542,18 @@ var drizzleAdapter = (db, options) => {
551
542
  ${schema2}
552
543
  `;
553
544
  }
545
+ if (fileExist) {
546
+ if (fileContent.includes(code)) {
547
+ return {
548
+ code: "",
549
+ fileName: filePath,
550
+ append: false
551
+ };
552
+ }
553
+ if (fileContent.includes("import")) {
554
+ code = code.replace(/import {.*?} from "drizzle-orm\/.*?";/, "");
555
+ }
556
+ }
554
557
  const formattedCode = await prettier.format(code, {
555
558
  semi: true,
556
559
  parser: "typescript",
@@ -1145,9 +1148,9 @@ var kyselyAdapter = (db, config) => {
1145
1148
  },
1146
1149
  async createSchema(options) {
1147
1150
  const { compileMigrations } = await getMigrations(options);
1148
- console.log(compileMigrations);
1151
+ const migrations = await compileMigrations();
1149
1152
  return {
1150
- code: await compileMigrations(),
1153
+ code: migrations,
1151
1154
  fileName: `./better-auth_migrations/${(/* @__PURE__ */ new Date()).toISOString()}.sql`
1152
1155
  };
1153
1156
  }
package/dist/api.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { A as AuthEndpoint, b as AuthMiddleware, y as callbackOAuth, X as changePassword, a as createAuthEndpoint, c as createAuthMiddleware, Q as createEmailVerificationToken, a1 as csrfMiddleware, _ as error, M as forgetPassword, N as forgetPasswordCallback, Z as getCSRFToken, u as getEndpoints, z as getSession, C as getSessionFromCtx, E as listSessions, $ as ok, o as optionsMiddleware, O as resetPassword, J as revokeSession, K as revokeSessions, v as router, T as sendVerificationEmail, D as sessionMiddleware, Y as setPassword, x as signInEmail, w as signInOAuth, L as signOut, a0 as signUpEmail, V as updateUser, U as verifyEmail } from './index-DH-qiFLO.js';
1
+ export { A as AuthEndpoint, b as AuthMiddleware, y as callbackOAuth, X as changePassword, a as createAuthEndpoint, c as createAuthMiddleware, Q as createEmailVerificationToken, a1 as csrfMiddleware, _ as error, M as forgetPassword, N as forgetPasswordCallback, Z as getCSRFToken, u as getEndpoints, z as getSession, C as getSessionFromCtx, E as listSessions, $ as ok, o as optionsMiddleware, O as resetPassword, J as revokeSession, K as revokeSessions, v as router, T as sendVerificationEmail, D as sessionMiddleware, Y as setPassword, x as signInEmail, w as signInOAuth, L as signOut, a0 as signUpEmail, V as updateUser, U as verifyEmail } from './index-gO-yM4kI.js';
2
2
  import 'zod';
3
3
  import './helper-C1ihmerM.js';
4
4
  import 'better-call';
package/dist/api.js CHANGED
@@ -113,6 +113,7 @@ var BetterAuthError = class extends Error {
113
113
  this.name = "BetterAuthError";
114
114
  this.message = message;
115
115
  this.cause = cause;
116
+ this.stack = "";
116
117
  }
117
118
  };
118
119
 
package/dist/cli.js CHANGED
@@ -145,6 +145,7 @@ var BetterAuthError = class extends Error {
145
145
  this.name = "BetterAuthError";
146
146
  this.message = message;
147
147
  this.cause = cause;
148
+ this.stack = "";
148
149
  }
149
150
  };
150
151
  var MissingDependencyError = class extends BetterAuthError {
@@ -702,12 +703,22 @@ var migrate = new Command("migrate").option(
702
703
 
703
704
  // src/cli/commands/generate.ts
704
705
  import { Command as Command2 } from "commander";
705
- import { z as z2 } from "zod";
706
+ import { z as z3 } from "zod";
706
707
  import { existsSync as existsSync2 } from "fs";
707
708
  import path3 from "path";
708
709
  import ora4 from "ora";
709
710
  import prompts4 from "prompts";
710
711
 
712
+ // src/utils/cookies.ts
713
+ import { TimeSpan } from "oslo";
714
+
715
+ // src/utils/id.ts
716
+ import { alphabet, generateRandomString } from "oslo/crypto";
717
+
718
+ // src/utils/state.ts
719
+ import { generateState as generateStateOAuth } from "oslo/oauth2";
720
+ import { z as z2 } from "zod";
721
+
711
722
  // src/adapters/kysely-adapter/index.ts
712
723
  function convertWhere(w) {
713
724
  if (!w)
@@ -869,9 +880,9 @@ var kyselyAdapter = (db, config) => {
869
880
  },
870
881
  async createSchema(options) {
871
882
  const { compileMigrations } = await getMigrations(options);
872
- console.log(compileMigrations);
883
+ const migrations = await compileMigrations();
873
884
  return {
874
- code: await compileMigrations(),
885
+ code: migrations,
875
886
  fileName: `./better-auth_migrations/${(/* @__PURE__ */ new Date()).toISOString()}.sql`
876
887
  };
877
888
  }
@@ -915,10 +926,10 @@ var generate = new Command2("generate").option(
915
926
  "--config <config>",
916
927
  "the path to the configuration file. defaults to the first configuration file found."
917
928
  ).option("--out <output>", "the file to output to the generated schema").option("--y", "").action(async (opts) => {
918
- const options = z2.object({
919
- cwd: z2.string(),
920
- config: z2.string().optional(),
921
- out: z2.string().optional()
929
+ const options = z3.object({
930
+ cwd: z3.string(),
931
+ config: z3.string().optional(),
932
+ out: z3.string().optional()
922
933
  }).parse(opts);
923
934
  const cwd = path3.resolve(options.cwd);
924
935
  if (!existsSync2(cwd)) {
@@ -935,7 +946,10 @@ var generate = new Command2("generate").option(
935
946
  );
936
947
  return;
937
948
  }
938
- const adapter = await getAdapter(config, true);
949
+ const adapter = await getAdapter(config, true).catch((e) => {
950
+ logger.error(e.message);
951
+ process.exit(1);
952
+ });
939
953
  if (!adapter.createSchema) {
940
954
  logger.error("The adapter does not support schema generation.");
941
955
  process.exit(1);
@@ -946,6 +960,10 @@ var generate = new Command2("generate").option(
946
960
  options.out
947
961
  );
948
962
  spinner.stop();
963
+ if (!code) {
964
+ logger.success("Your schema is already up to date.");
965
+ process.exit(0);
966
+ }
949
967
  if (append) {
950
968
  const { append: append2 } = await prompts4({
951
969
  type: "confirm",
@@ -2,14 +2,14 @@ import * as nanostores from 'nanostores';
2
2
  import { A as AccessControl, S as StatementsPrimitive, R as Role } from '../statement-CU-fdHXK.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, d as Organization, M as Member, I as Invitation, u as username, m as magicLink } from '../index-DeH0CN6S.js';
6
- export { g as getPasskeyActions, c as passkeyClient, a as twoFactorClient } from '../index-DeH0CN6S.js';
5
+ import { o as organization, d as Organization, M as Member, I as Invitation, u as username, m as magicLink } from '../index-CmzUOocy.js';
6
+ export { g as getPasskeyActions, c as passkeyClient, a as twoFactorClient } from '../index-CmzUOocy.js';
7
7
  import { P as Prettify } from '../helper-C1ihmerM.js';
8
8
  import '../index-CE92ti2Z.js';
9
9
  import 'arctic';
10
10
  import 'zod';
11
11
  import 'better-call';
12
- import '../index-DH-qiFLO.js';
12
+ import '../index-gO-yM4kI.js';
13
13
  import 'kysely';
14
14
  import '@simplewebauthn/types';
15
15
 
package/dist/client.d.ts CHANGED
@@ -3,7 +3,7 @@ import * as nanostores from 'nanostores';
3
3
  import { PreinitializedWritableAtom } from 'nanostores';
4
4
  import * as _better_fetch_fetch from '@better-fetch/fetch';
5
5
  import { BetterFetch, BetterFetchError, BetterFetchOption } from '@better-fetch/fetch';
6
- import { B as BetterAuthPlugin, F as FieldAttribute, I as InferFieldOutput } from './index-DH-qiFLO.js';
6
+ import { B as BetterAuthPlugin, F as FieldAttribute, I as InferFieldOutput } from './index-gO-yM4kI.js';
7
7
  import { U as UnionToIntersection, P as Prettify } from './helper-C1ihmerM.js';
8
8
  import { ClientOptions, InferClientAPI, InferActions, BetterAuthClientPlugin, InferSessionFromClient, InferUserFromClient, IsSignal } from './types.js';
9
9
  export { AtomListener, InferPluginsFromClient } from './types.js';
package/dist/client.js CHANGED
@@ -8,6 +8,7 @@ var BetterAuthError = class extends Error {
8
8
  this.name = "BetterAuthError";
9
9
  this.message = message;
10
10
  this.cause = cause;
11
+ this.stack = "";
11
12
  }
12
13
  };
13
14
 
@@ -5,7 +5,7 @@ import { P as Prettify } from './helper-C1ihmerM.js';
5
5
  import { A as AccessControl, R as Role, S as StatementsPrimitive, g as defaultRoles } from './statement-CU-fdHXK.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 } from './index-DH-qiFLO.js';
8
+ import { H as HookEndpointContext } from './index-gO-yM4kI.js';
9
9
  import * as nanostores from 'nanostores';
10
10
  import { atom } from 'nanostores';
11
11
  import * as _simplewebauthn_types from '@simplewebauthn/types';
@@ -1291,17 +1291,17 @@ declare const signInOAuth: {
1291
1291
  /**
1292
1292
  * OAuth2 provider to use`
1293
1293
  */
1294
- provider: z.ZodEnum<["github", ...("github" | "apple" | "discord" | "facebook" | "google" | "spotify" | "twitch" | "twitter")[]]>;
1294
+ provider: z.ZodEnum<["github", ...("apple" | "discord" | "facebook" | "github" | "google" | "spotify" | "twitch" | "twitter")[]]>;
1295
1295
  /**
1296
1296
  * If this is true the session will only be valid for the current browser session
1297
1297
  */
1298
1298
  dontRememberMe: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
1299
1299
  }, "strip", z.ZodTypeAny, {
1300
- provider: "github" | "apple" | "discord" | "facebook" | "google" | "spotify" | "twitch" | "twitter";
1300
+ provider: "apple" | "discord" | "facebook" | "github" | "google" | "spotify" | "twitch" | "twitter";
1301
1301
  callbackURL?: string | undefined;
1302
1302
  dontRememberMe?: boolean | undefined;
1303
1303
  }, {
1304
- provider: "github" | "apple" | "discord" | "facebook" | "google" | "spotify" | "twitch" | "twitter";
1304
+ provider: "apple" | "discord" | "facebook" | "github" | "google" | "spotify" | "twitch" | "twitter";
1305
1305
  callbackURL?: string | undefined;
1306
1306
  dontRememberMe?: boolean | undefined;
1307
1307
  }>;
@@ -1334,17 +1334,17 @@ declare const signInOAuth: {
1334
1334
  /**
1335
1335
  * OAuth2 provider to use`
1336
1336
  */
1337
- provider: z.ZodEnum<["github", ...("github" | "apple" | "discord" | "facebook" | "google" | "spotify" | "twitch" | "twitter")[]]>;
1337
+ provider: z.ZodEnum<["github", ...("apple" | "discord" | "facebook" | "github" | "google" | "spotify" | "twitch" | "twitter")[]]>;
1338
1338
  /**
1339
1339
  * If this is true the session will only be valid for the current browser session
1340
1340
  */
1341
1341
  dontRememberMe: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
1342
1342
  }, "strip", z.ZodTypeAny, {
1343
- provider: "github" | "apple" | "discord" | "facebook" | "google" | "spotify" | "twitch" | "twitter";
1343
+ provider: "apple" | "discord" | "facebook" | "github" | "google" | "spotify" | "twitch" | "twitter";
1344
1344
  callbackURL?: string | undefined;
1345
1345
  dontRememberMe?: boolean | undefined;
1346
1346
  }, {
1347
- provider: "github" | "apple" | "discord" | "facebook" | "google" | "spotify" | "twitch" | "twitter";
1347
+ provider: "apple" | "discord" | "facebook" | "github" | "google" | "spotify" | "twitch" | "twitter";
1348
1348
  callbackURL?: string | undefined;
1349
1349
  dontRememberMe?: boolean | undefined;
1350
1350
  }>;
@@ -2428,14 +2428,14 @@ declare function getEndpoints<C extends AuthContext, Option extends BetterAuthOp
2428
2428
  }>>;
2429
2429
  body: zod.ZodObject<{
2430
2430
  callbackURL: zod.ZodOptional<zod.ZodString>;
2431
- provider: zod.ZodEnum<["github", ...("github" | "apple" | "discord" | "facebook" | "google" | "spotify" | "twitch" | "twitter")[]]>;
2431
+ provider: zod.ZodEnum<["github", ...("apple" | "discord" | "facebook" | "github" | "google" | "spotify" | "twitch" | "twitter")[]]>;
2432
2432
  dontRememberMe: zod.ZodOptional<zod.ZodDefault<zod.ZodBoolean>>;
2433
2433
  }, "strip", zod.ZodTypeAny, {
2434
- provider: "github" | "apple" | "discord" | "facebook" | "google" | "spotify" | "twitch" | "twitter";
2434
+ provider: "apple" | "discord" | "facebook" | "github" | "google" | "spotify" | "twitch" | "twitter";
2435
2435
  callbackURL?: string | undefined;
2436
2436
  dontRememberMe?: boolean | undefined;
2437
2437
  }, {
2438
- provider: "github" | "apple" | "discord" | "facebook" | "google" | "spotify" | "twitch" | "twitter";
2438
+ provider: "apple" | "discord" | "facebook" | "github" | "google" | "spotify" | "twitch" | "twitter";
2439
2439
  callbackURL?: string | undefined;
2440
2440
  dontRememberMe?: boolean | undefined;
2441
2441
  }>;
@@ -2458,14 +2458,14 @@ declare function getEndpoints<C extends AuthContext, Option extends BetterAuthOp
2458
2458
  }>>;
2459
2459
  body: zod.ZodObject<{
2460
2460
  callbackURL: zod.ZodOptional<zod.ZodString>;
2461
- provider: zod.ZodEnum<["github", ...("github" | "apple" | "discord" | "facebook" | "google" | "spotify" | "twitch" | "twitter")[]]>;
2461
+ provider: zod.ZodEnum<["github", ...("apple" | "discord" | "facebook" | "github" | "google" | "spotify" | "twitch" | "twitter")[]]>;
2462
2462
  dontRememberMe: zod.ZodOptional<zod.ZodDefault<zod.ZodBoolean>>;
2463
2463
  }, "strip", zod.ZodTypeAny, {
2464
- provider: "github" | "apple" | "discord" | "facebook" | "google" | "spotify" | "twitch" | "twitter";
2464
+ provider: "apple" | "discord" | "facebook" | "github" | "google" | "spotify" | "twitch" | "twitter";
2465
2465
  callbackURL?: string | undefined;
2466
2466
  dontRememberMe?: boolean | undefined;
2467
2467
  }, {
2468
- provider: "github" | "apple" | "discord" | "facebook" | "google" | "spotify" | "twitch" | "twitter";
2468
+ provider: "apple" | "discord" | "facebook" | "github" | "google" | "spotify" | "twitch" | "twitter";
2469
2469
  callbackURL?: string | undefined;
2470
2470
  dontRememberMe?: boolean | undefined;
2471
2471
  }>;
@@ -3425,14 +3425,14 @@ declare const router: <C extends AuthContext, Option extends BetterAuthOptions>(
3425
3425
  }>>;
3426
3426
  body: zod.ZodObject<{
3427
3427
  callbackURL: zod.ZodOptional<zod.ZodString>;
3428
- provider: zod.ZodEnum<["github", ...("github" | "apple" | "discord" | "facebook" | "google" | "spotify" | "twitch" | "twitter")[]]>;
3428
+ provider: zod.ZodEnum<["github", ...("apple" | "discord" | "facebook" | "github" | "google" | "spotify" | "twitch" | "twitter")[]]>;
3429
3429
  dontRememberMe: zod.ZodOptional<zod.ZodDefault<zod.ZodBoolean>>;
3430
3430
  }, "strip", zod.ZodTypeAny, {
3431
- provider: "github" | "apple" | "discord" | "facebook" | "google" | "spotify" | "twitch" | "twitter";
3431
+ provider: "apple" | "discord" | "facebook" | "github" | "google" | "spotify" | "twitch" | "twitter";
3432
3432
  callbackURL?: string | undefined;
3433
3433
  dontRememberMe?: boolean | undefined;
3434
3434
  }, {
3435
- provider: "github" | "apple" | "discord" | "facebook" | "google" | "spotify" | "twitch" | "twitter";
3435
+ provider: "apple" | "discord" | "facebook" | "github" | "google" | "spotify" | "twitch" | "twitter";
3436
3436
  callbackURL?: string | undefined;
3437
3437
  dontRememberMe?: boolean | undefined;
3438
3438
  }>;
@@ -3455,14 +3455,14 @@ declare const router: <C extends AuthContext, Option extends BetterAuthOptions>(
3455
3455
  }>>;
3456
3456
  body: zod.ZodObject<{
3457
3457
  callbackURL: zod.ZodOptional<zod.ZodString>;
3458
- provider: zod.ZodEnum<["github", ...("github" | "apple" | "discord" | "facebook" | "google" | "spotify" | "twitch" | "twitter")[]]>;
3458
+ provider: zod.ZodEnum<["github", ...("apple" | "discord" | "facebook" | "github" | "google" | "spotify" | "twitch" | "twitter")[]]>;
3459
3459
  dontRememberMe: zod.ZodOptional<zod.ZodDefault<zod.ZodBoolean>>;
3460
3460
  }, "strip", zod.ZodTypeAny, {
3461
- provider: "github" | "apple" | "discord" | "facebook" | "google" | "spotify" | "twitch" | "twitter";
3461
+ provider: "apple" | "discord" | "facebook" | "github" | "google" | "spotify" | "twitch" | "twitter";
3462
3462
  callbackURL?: string | undefined;
3463
3463
  dontRememberMe?: boolean | undefined;
3464
3464
  }, {
3465
- provider: "github" | "apple" | "discord" | "facebook" | "google" | "spotify" | "twitch" | "twitter";
3465
+ provider: "apple" | "discord" | "facebook" | "github" | "google" | "spotify" | "twitch" | "twitter";
3466
3466
  callbackURL?: string | undefined;
3467
3467
  dontRememberMe?: boolean | undefined;
3468
3468
  }>;
@@ -4424,14 +4424,14 @@ declare const betterAuth: <O extends BetterAuthOptions>(options: O) => {
4424
4424
  }>>;
4425
4425
  body: zod.ZodObject<{
4426
4426
  callbackURL: zod.ZodOptional<zod.ZodString>;
4427
- provider: zod.ZodEnum<["github", ...("github" | "apple" | "discord" | "facebook" | "google" | "spotify" | "twitch" | "twitter")[]]>;
4427
+ provider: zod.ZodEnum<["github", ...("apple" | "discord" | "facebook" | "github" | "google" | "spotify" | "twitch" | "twitter")[]]>;
4428
4428
  dontRememberMe: zod.ZodOptional<zod.ZodDefault<zod.ZodBoolean>>;
4429
4429
  }, "strip", zod.ZodTypeAny, {
4430
- provider: "github" | "apple" | "discord" | "facebook" | "google" | "spotify" | "twitch" | "twitter";
4430
+ provider: "apple" | "discord" | "facebook" | "github" | "google" | "spotify" | "twitch" | "twitter";
4431
4431
  callbackURL?: string | undefined;
4432
4432
  dontRememberMe?: boolean | undefined;
4433
4433
  }, {
4434
- provider: "github" | "apple" | "discord" | "facebook" | "google" | "spotify" | "twitch" | "twitter";
4434
+ provider: "apple" | "discord" | "facebook" | "github" | "google" | "spotify" | "twitch" | "twitter";
4435
4435
  callbackURL?: string | undefined;
4436
4436
  dontRememberMe?: boolean | undefined;
4437
4437
  }>;
@@ -4454,14 +4454,14 @@ declare const betterAuth: <O extends BetterAuthOptions>(options: O) => {
4454
4454
  }>>;
4455
4455
  body: zod.ZodObject<{
4456
4456
  callbackURL: zod.ZodOptional<zod.ZodString>;
4457
- provider: zod.ZodEnum<["github", ...("github" | "apple" | "discord" | "facebook" | "google" | "spotify" | "twitch" | "twitter")[]]>;
4457
+ provider: zod.ZodEnum<["github", ...("apple" | "discord" | "facebook" | "github" | "google" | "spotify" | "twitch" | "twitter")[]]>;
4458
4458
  dontRememberMe: zod.ZodOptional<zod.ZodDefault<zod.ZodBoolean>>;
4459
4459
  }, "strip", zod.ZodTypeAny, {
4460
- provider: "github" | "apple" | "discord" | "facebook" | "google" | "spotify" | "twitch" | "twitter";
4460
+ provider: "apple" | "discord" | "facebook" | "github" | "google" | "spotify" | "twitch" | "twitter";
4461
4461
  callbackURL?: string | undefined;
4462
4462
  dontRememberMe?: boolean | undefined;
4463
4463
  }, {
4464
- provider: "github" | "apple" | "discord" | "facebook" | "google" | "spotify" | "twitch" | "twitter";
4464
+ provider: "apple" | "discord" | "facebook" | "github" | "google" | "spotify" | "twitch" | "twitter";
4465
4465
  callbackURL?: string | undefined;
4466
4466
  dontRememberMe?: boolean | undefined;
4467
4467
  }>;
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { d as Auth, a2 as betterAuth } from './index-DH-qiFLO.js';
1
+ export { d as Auth, a2 as betterAuth } from './index-gO-yM4kI.js';
2
2
  import 'kysely';
3
3
  import './index-CE92ti2Z.js';
4
4
  import 'arctic';
package/dist/index.js CHANGED
@@ -113,6 +113,7 @@ var BetterAuthError = class extends Error {
113
113
  this.name = "BetterAuthError";
114
114
  this.message = message;
115
115
  this.cause = cause;
116
+ this.stack = "";
116
117
  }
117
118
  };
118
119
  var MissingDependencyError = class extends BetterAuthError {
@@ -3231,9 +3232,9 @@ var kyselyAdapter = (db, config2) => {
3231
3232
  },
3232
3233
  async createSchema(options) {
3233
3234
  const { compileMigrations } = await getMigrations(options);
3234
- console.log(compileMigrations);
3235
+ const migrations = await compileMigrations();
3235
3236
  return {
3236
- code: await compileMigrations(),
3237
+ code: migrations,
3237
3238
  fileName: `./better-auth_migrations/${(/* @__PURE__ */ new Date()).toISOString()}.sql`
3238
3239
  };
3239
3240
  }
package/dist/next-js.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { d as Auth } from './index-DH-qiFLO.js';
1
+ import { d as Auth } from './index-gO-yM4kI.js';
2
2
  import { U as User, S as Session } from './index-CE92ti2Z.js';
3
3
  import { NextRequest } from 'next/server';
4
4
  import 'kysely';
package/dist/node.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as http from 'http';
2
- import { d as Auth } from './index-DH-qiFLO.js';
2
+ import { d as Auth } from './index-gO-yM4kI.js';
3
3
  import 'kysely';
4
4
  import './index-CE92ti2Z.js';
5
5
  import 'arctic';
package/dist/plugins.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- export { O as OrganizationOptions, b as Passkey, P as PasskeyOptions, W as WebAuthnCookieType, g as getPasskeyActions, m as magicLink, o as organization, p as passkey, c as passkeyClient, t as twoFactor, a as twoFactorClient, u as username } from './index-DeH0CN6S.js';
1
+ export { O as OrganizationOptions, b as Passkey, P as PasskeyOptions, W as WebAuthnCookieType, g as getPasskeyActions, m as magicLink, o as organization, p as passkey, c as passkeyClient, t as twoFactor, a as twoFactorClient, u as username } from './index-CmzUOocy.js';
2
2
  export { i as ac } from './index-D6NOkCRo.js';
3
- import { H as HookEndpointContext } from './index-DH-qiFLO.js';
4
- export { A as AuthEndpoint, b as AuthMiddleware, B as BetterAuthPlugin, P as PluginSchema, a as createAuthEndpoint, c as createAuthMiddleware, o as optionsMiddleware } from './index-DH-qiFLO.js';
3
+ import { H as HookEndpointContext } from './index-gO-yM4kI.js';
4
+ export { A as AuthEndpoint, b as AuthMiddleware, B as BetterAuthPlugin, P as PluginSchema, a as createAuthEndpoint, c as createAuthMiddleware, o as optionsMiddleware } from './index-gO-yM4kI.js';
5
5
  export { H as HIDE_METADATA } from './hide-metadata-DEHJp1rk.js';
6
6
  import './index-CE92ti2Z.js';
7
7
  import 'arctic';
package/dist/plugins.js CHANGED
@@ -51,6 +51,7 @@ var BetterAuthError = class extends Error {
51
51
  this.name = "BetterAuthError";
52
52
  this.message = message;
53
53
  this.cause = cause;
54
+ this.stack = "";
54
55
  }
55
56
  };
56
57
 
package/dist/react.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as _better_fetch_fetch from '@better-fetch/fetch';
2
- import { B as BetterAuthPlugin, F as FieldAttribute, I as InferFieldOutput } from './index-DH-qiFLO.js';
2
+ import { B as BetterAuthPlugin, F as FieldAttribute, I as InferFieldOutput } from './index-gO-yM4kI.js';
3
3
  import { U as UnionToIntersection, P as Prettify } from './helper-C1ihmerM.js';
4
4
  import { ClientOptions, InferClientAPI, InferActions, BetterAuthClientPlugin, IsSignal } from './types.js';
5
5
  import { useStore } from '@nanostores/react';
package/dist/react.js CHANGED
@@ -11,6 +11,7 @@ var BetterAuthError = class extends Error {
11
11
  this.name = "BetterAuthError";
12
12
  this.message = message;
13
13
  this.cause = cause;
14
+ this.stack = "";
14
15
  }
15
16
  };
16
17
 
package/dist/social.js CHANGED
@@ -10,6 +10,7 @@ var BetterAuthError = class extends Error {
10
10
  this.name = "BetterAuthError";
11
11
  this.message = message;
12
12
  this.cause = cause;
13
+ this.stack = "";
13
14
  }
14
15
  };
15
16
 
@@ -1,4 +1,4 @@
1
- import { d as Auth } from './index-DH-qiFLO.js';
1
+ import { d as Auth } from './index-gO-yM4kI.js';
2
2
  import 'kysely';
3
3
  import './index-CE92ti2Z.js';
4
4
  import 'arctic';
package/dist/solid.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as _better_fetch_fetch from '@better-fetch/fetch';
2
- import { B as BetterAuthPlugin, F as FieldAttribute, I as InferFieldOutput } from './index-DH-qiFLO.js';
2
+ import { B as BetterAuthPlugin, F as FieldAttribute, I as InferFieldOutput } from './index-gO-yM4kI.js';
3
3
  import { U as UnionToIntersection, P as Prettify } from './helper-C1ihmerM.js';
4
4
  import { ClientOptions, InferClientAPI, InferActions, BetterAuthClientPlugin, IsSignal } from './types.js';
5
5
  import { Accessor } from 'solid-js';
package/dist/solid.js CHANGED
@@ -11,6 +11,7 @@ var BetterAuthError = class extends Error {
11
11
  this.name = "BetterAuthError";
12
12
  this.message = message;
13
13
  this.cause = cause;
14
+ this.stack = "";
14
15
  }
15
16
  };
16
17
 
@@ -1,4 +1,4 @@
1
- import { d as Auth, e as BetterAuthOptions } from './index-DH-qiFLO.js';
1
+ import { d as Auth, e as BetterAuthOptions } from './index-gO-yM4kI.js';
2
2
  import 'kysely';
3
3
  import './index-CE92ti2Z.js';
4
4
  import 'arctic';
package/dist/svelte.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as nanostores from 'nanostores';
2
2
  import * as _better_fetch_fetch from '@better-fetch/fetch';
3
- import { B as BetterAuthPlugin, F as FieldAttribute, I as InferFieldOutput } from './index-DH-qiFLO.js';
3
+ import { B as BetterAuthPlugin, F as FieldAttribute, I as InferFieldOutput } from './index-gO-yM4kI.js';
4
4
  import { U as UnionToIntersection, P as Prettify } from './helper-C1ihmerM.js';
5
5
  import { ClientOptions, InferClientAPI, InferActions, BetterAuthClientPlugin, IsSignal } from './types.js';
6
6
  import 'kysely';
package/dist/svelte.js CHANGED
@@ -8,6 +8,7 @@ var BetterAuthError = class extends Error {
8
8
  this.name = "BetterAuthError";
9
9
  this.message = message;
10
10
  this.cause = cause;
11
+ this.stack = "";
11
12
  }
12
13
  };
13
14
 
package/dist/types.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { B as BetterAuthPlugin, d as Auth, n as InferSession, q as InferUser } from './index-DH-qiFLO.js';
2
- export { f as Adapter, g as AuthContext, e as BetterAuthOptions, G as GenericEndpointContext, H as HookEndpointContext, r as InferPluginTypes, P as PluginSchema, R as RateLimit, S as SessionAdapter, W as Where, t as init } from './index-DH-qiFLO.js';
1
+ import { B as BetterAuthPlugin, d as Auth, n as InferSession, q as InferUser } from './index-gO-yM4kI.js';
2
+ export { f as Adapter, g as AuthContext, e as BetterAuthOptions, G as GenericEndpointContext, H as HookEndpointContext, r as InferPluginTypes, P as PluginSchema, R as RateLimit, S as SessionAdapter, W as Where, t as init } from './index-gO-yM4kI.js';
3
3
  import { U as UnionToIntersection, H as HasRequiredKeys, P as Prettify, L as LiteralString } from './helper-C1ihmerM.js';
4
4
  export { a as LiteralUnion, R as RequiredKeysOf, W as WithoutEmpty } from './helper-C1ihmerM.js';
5
5
  export { O as OAuthProvider, f as OAuthProviderList, P as ProviderOptions, S as Session, U as User } from './index-CE92ti2Z.js';
package/dist/utils.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { g as AuthContext, G as GenericEndpointContext } from './index-DH-qiFLO.js';
2
- export { j as BetterAuthCookies, i as createCookieGetter, l as createLogger, k as deleteSessionCookie, h as getCookies, m as logger, p as parseSetCookieHeader, s as setSessionCookie } from './index-DH-qiFLO.js';
1
+ import { g as AuthContext, G as GenericEndpointContext } from './index-gO-yM4kI.js';
2
+ export { j as BetterAuthCookies, i as createCookieGetter, l as createLogger, k as deleteSessionCookie, h as getCookies, m as logger, p as parseSetCookieHeader, s as setSessionCookie } from './index-gO-yM4kI.js';
3
3
  export { H as HIDE_METADATA } from './hide-metadata-DEHJp1rk.js';
4
4
  import { z } from 'zod';
5
5
  import 'kysely';
package/dist/utils.js CHANGED
@@ -75,6 +75,7 @@ var BetterAuthError = class extends Error {
75
75
  this.name = "BetterAuthError";
76
76
  this.message = message;
77
77
  this.cause = cause;
78
+ this.stack = "";
78
79
  }
79
80
  };
80
81
 
package/dist/vue.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as _better_fetch_fetch from '@better-fetch/fetch';
2
- import { B as BetterAuthPlugin, F as FieldAttribute, I as InferFieldOutput } from './index-DH-qiFLO.js';
2
+ import { B as BetterAuthPlugin, F as FieldAttribute, I as InferFieldOutput } from './index-gO-yM4kI.js';
3
3
  import { U as UnionToIntersection, P as Prettify } from './helper-C1ihmerM.js';
4
4
  import { ClientOptions, InferClientAPI, InferActions, BetterAuthClientPlugin, IsSignal } from './types.js';
5
5
  import { Ref, DeepReadonly } from 'vue';
package/dist/vue.js CHANGED
@@ -11,6 +11,7 @@ var BetterAuthError = class extends Error {
11
11
  this.name = "BetterAuthError";
12
12
  this.message = message;
13
13
  this.cause = cause;
14
+ this.stack = "";
14
15
  }
15
16
  };
16
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "better-auth",
3
- "version": "0.2.3-beta.12",
3
+ "version": "0.2.3-beta.14",
4
4
  "description": "The most comprehensive authentication library for TypeScript.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",