better-auth 0.4.4 → 0.4.5

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/plugins.js CHANGED
@@ -961,39 +961,39 @@ var signInOAuth = createAuthEndpoint(
961
961
  provider: z3.enum(oAuthProviderList)
962
962
  })
963
963
  },
964
- async (c) => {
965
- const provider = c.context.socialProviders.find(
966
- (p) => p.id === c.body.provider
964
+ async (c2) => {
965
+ const provider = c2.context.socialProviders.find(
966
+ (p) => p.id === c2.body.provider
967
967
  );
968
968
  if (!provider) {
969
- c.context.logger.error(
969
+ c2.context.logger.error(
970
970
  "Provider not found. Make sure to add the provider to your auth config",
971
971
  {
972
- provider: c.body.provider
972
+ provider: c2.body.provider
973
973
  }
974
974
  );
975
975
  throw new APIError2("NOT_FOUND", {
976
976
  message: "Provider not found"
977
977
  });
978
978
  }
979
- const cookie = c.context.authCookies;
980
- const currentURL = c.query?.currentURL ? new URL(c.query?.currentURL) : null;
981
- const callbackURL = c.body.callbackURL?.startsWith("http") ? c.body.callbackURL : `${currentURL?.origin}${c.body.callbackURL || ""}`;
979
+ const cookie = c2.context.authCookies;
980
+ const currentURL = c2.query?.currentURL ? new URL(c2.query?.currentURL) : null;
981
+ const callbackURL = c2.body.callbackURL?.startsWith("http") ? c2.body.callbackURL : `${currentURL?.origin}${c2.body.callbackURL || ""}`;
982
982
  const state = generateState(
983
- callbackURL || currentURL?.origin || c.context.baseURL,
984
- c.query?.currentURL
983
+ callbackURL || currentURL?.origin || c2.context.baseURL,
984
+ c2.query?.currentURL
985
985
  );
986
- await c.setSignedCookie(
986
+ await c2.setSignedCookie(
987
987
  cookie.state.name,
988
988
  state.code,
989
- c.context.secret,
989
+ c2.context.secret,
990
990
  cookie.state.options
991
991
  );
992
992
  const codeVerifier = generateCodeVerifier();
993
- await c.setSignedCookie(
993
+ await c2.setSignedCookie(
994
994
  cookie.pkCodeVerifier.name,
995
995
  codeVerifier,
996
- c.context.secret,
996
+ c2.context.secret,
997
997
  cookie.pkCodeVerifier.options
998
998
  );
999
999
  const url = await provider.createAuthorizationURL({
@@ -1002,9 +1002,9 @@ var signInOAuth = createAuthEndpoint(
1002
1002
  });
1003
1003
  url.searchParams.set(
1004
1004
  "redirect_uri",
1005
- `${c.context.baseURL}/callback/${c.body.provider}`
1005
+ `${c2.context.baseURL}/callback/${c2.body.provider}`
1006
1006
  );
1007
- return c.json({
1007
+ return c2.json({
1008
1008
  url: url.toString(),
1009
1009
  state: state.state,
1010
1010
  codeVerifier,
@@ -1049,7 +1049,9 @@ var signInEmail = createAuthEndpoint(
1049
1049
  message: "Invalid email"
1050
1050
  });
1051
1051
  }
1052
- const user = await ctx.context.internalAdapter.findUserByEmail(email);
1052
+ const user = await ctx.context.internalAdapter.findUserByEmail(email, {
1053
+ includeAccounts: true
1054
+ });
1053
1055
  if (!user) {
1054
1056
  await ctx.context.password.hash(password);
1055
1057
  ctx.context.logger.error("User not found", { email });
@@ -1103,6 +1105,17 @@ var signInEmail = createAuthEndpoint(
1103
1105
  });
1104
1106
  }
1105
1107
  );
1108
+ var c = (o) => {
1109
+ };
1110
+ c({
1111
+ additional: {
1112
+ name: "string"
1113
+ },
1114
+ hooks: {
1115
+ create(user) {
1116
+ }
1117
+ }
1118
+ });
1106
1119
 
1107
1120
  // src/api/routes/callback.ts
1108
1121
  import { APIError as APIError3 } from "better-call";
@@ -1211,10 +1224,10 @@ function generateRandomInteger(max) {
1211
1224
  }
1212
1225
  return result;
1213
1226
  }
1214
- function generateRandomString(length, alphabet3) {
1227
+ function generateRandomString(length, alphabet4) {
1215
1228
  let result = "";
1216
1229
  for (let i = 0; i < length; i++) {
1217
- result += alphabet3[generateRandomInteger(alphabet3.length)];
1230
+ result += alphabet4[generateRandomInteger(alphabet4.length)];
1218
1231
  }
1219
1232
  return result;
1220
1233
  }
@@ -1273,63 +1286,63 @@ var callbackOAuth = createAuthEndpoint(
1273
1286
  }),
1274
1287
  metadata: HIDE_METADATA
1275
1288
  },
1276
- async (c) => {
1277
- if (c.query.error || !c.query.code) {
1278
- const parsedState2 = parseState(c.query.state);
1279
- const callbackURL2 = parsedState2.data?.callbackURL || `${c.context.baseURL}/error`;
1280
- c.context.logger.error(c.query.error, c.params.id);
1281
- throw c.redirect(
1282
- `${callbackURL2}?error=${c.query.error || "oAuth_code_missing"}`
1289
+ async (c2) => {
1290
+ if (c2.query.error || !c2.query.code) {
1291
+ const parsedState2 = parseState(c2.query.state);
1292
+ const callbackURL2 = parsedState2.data?.callbackURL || `${c2.context.baseURL}/error`;
1293
+ c2.context.logger.error(c2.query.error, c2.params.id);
1294
+ throw c2.redirect(
1295
+ `${callbackURL2}?error=${c2.query.error || "oAuth_code_missing"}`
1283
1296
  );
1284
1297
  }
1285
- const provider = c.context.socialProviders.find(
1286
- (p) => p.id === c.params.id
1298
+ const provider = c2.context.socialProviders.find(
1299
+ (p) => p.id === c2.params.id
1287
1300
  );
1288
1301
  if (!provider) {
1289
- c.context.logger.error(
1302
+ c2.context.logger.error(
1290
1303
  "Oauth provider with id",
1291
- c.params.id,
1304
+ c2.params.id,
1292
1305
  "not found"
1293
1306
  );
1294
- throw c.redirect(
1295
- `${c.context.baseURL}/error?error=oauth_provider_not_found`
1307
+ throw c2.redirect(
1308
+ `${c2.context.baseURL}/error?error=oauth_provider_not_found`
1296
1309
  );
1297
1310
  }
1298
- const parsedState = parseState(c.query.state);
1311
+ const parsedState = parseState(c2.query.state);
1299
1312
  if (!parsedState.success) {
1300
- c.context.logger.error("Unable to parse state");
1301
- throw c.redirect(
1302
- `${c.context.baseURL}/error?error=please_restart_the_process`
1313
+ c2.context.logger.error("Unable to parse state");
1314
+ throw c2.redirect(
1315
+ `${c2.context.baseURL}/error?error=please_restart_the_process`
1303
1316
  );
1304
1317
  }
1305
1318
  const {
1306
1319
  data: { callbackURL, currentURL, code: stateCode }
1307
1320
  } = parsedState;
1308
- const storedState = await c.getSignedCookie(
1309
- c.context.authCookies.state.name,
1310
- c.context.secret
1321
+ const storedState = await c2.getSignedCookie(
1322
+ c2.context.authCookies.state.name,
1323
+ c2.context.secret
1311
1324
  );
1312
1325
  if (storedState !== stateCode) {
1313
1326
  logger.error("OAuth state mismatch", storedState, stateCode);
1314
- throw c.redirect(
1315
- `${c.context.baseURL}/error?error=please_restart_the_process`
1327
+ throw c2.redirect(
1328
+ `${c2.context.baseURL}/error?error=please_restart_the_process`
1316
1329
  );
1317
1330
  }
1318
- const codeVerifier = await c.getSignedCookie(
1319
- c.context.authCookies.pkCodeVerifier.name,
1320
- c.context.secret
1331
+ const codeVerifier = await c2.getSignedCookie(
1332
+ c2.context.authCookies.pkCodeVerifier.name,
1333
+ c2.context.secret
1321
1334
  );
1322
1335
  let tokens;
1323
1336
  try {
1324
1337
  tokens = await provider.validateAuthorizationCode(
1325
- c.query.code,
1338
+ c2.query.code,
1326
1339
  codeVerifier,
1327
- `${c.context.baseURL}/callback/${provider.id}`
1340
+ `${c2.context.baseURL}/callback/${provider.id}`
1328
1341
  );
1329
1342
  } catch (e) {
1330
- c.context.logger.error(e);
1331
- throw c.redirect(
1332
- `${c.context.baseURL}/error?error=please_restart_the_process`
1343
+ c2.context.logger.error(e);
1344
+ throw c2.redirect(
1345
+ `${c2.context.baseURL}/error?error=please_restart_the_process`
1333
1346
  );
1334
1347
  }
1335
1348
  const user = await provider.getUserInfo(tokens).then((res) => res?.user);
@@ -1340,22 +1353,24 @@ var callbackOAuth = createAuthEndpoint(
1340
1353
  });
1341
1354
  if (!user || data.success === false) {
1342
1355
  logger.error("Unable to get user info", data.error);
1343
- throw c.redirect(
1344
- `${c.context.baseURL}/error?error=please_restart_the_process`
1356
+ throw c2.redirect(
1357
+ `${c2.context.baseURL}/error?error=please_restart_the_process`
1345
1358
  );
1346
1359
  }
1347
1360
  if (!callbackURL) {
1348
- throw c.redirect(
1349
- `${c.context.baseURL}/error?error=please_restart_the_process`
1361
+ throw c2.redirect(
1362
+ `${c2.context.baseURL}/error?error=please_restart_the_process`
1350
1363
  );
1351
1364
  }
1352
- const dbUser = await c.context.internalAdapter.findUserByEmail(user.email).catch((e) => {
1365
+ const dbUser = await c2.context.internalAdapter.findUserByEmail(user.email, {
1366
+ includeAccounts: true
1367
+ }).catch((e) => {
1353
1368
  logger.error(
1354
1369
  "Better auth was unable to query your database.\nError: ",
1355
1370
  e
1356
1371
  );
1357
- throw c.redirect(
1358
- `${c.context.baseURL}/error?error=internal_server_error`
1372
+ throw c2.redirect(
1373
+ `${c2.context.baseURL}/error?error=internal_server_error`
1359
1374
  );
1360
1375
  });
1361
1376
  const userId = dbUser?.user.id;
@@ -1363,7 +1378,7 @@ var callbackOAuth = createAuthEndpoint(
1363
1378
  const hasBeenLinked = dbUser.accounts.find(
1364
1379
  (a) => a.providerId === provider.id
1365
1380
  );
1366
- const trustedProviders = c.context.options.account?.accountLinking?.trustedProviders;
1381
+ const trustedProviders = c2.context.options.account?.accountLinking?.trustedProviders;
1367
1382
  const isTrustedProvider = trustedProviders ? trustedProviders.includes(provider.id) : true;
1368
1383
  if (!hasBeenLinked && (!user.emailVerified || !isTrustedProvider)) {
1369
1384
  let url;
@@ -1371,15 +1386,15 @@ var callbackOAuth = createAuthEndpoint(
1371
1386
  url = new URL(currentURL || callbackURL);
1372
1387
  url.searchParams.set("error", "account_not_linked");
1373
1388
  } catch (e) {
1374
- throw c.redirect(
1375
- `${c.context.baseURL}/error?error=account_not_linked`
1389
+ throw c2.redirect(
1390
+ `${c2.context.baseURL}/error?error=account_not_linked`
1376
1391
  );
1377
1392
  }
1378
- throw c.redirect(url.toString());
1393
+ throw c2.redirect(url.toString());
1379
1394
  }
1380
1395
  if (!hasBeenLinked) {
1381
1396
  try {
1382
- await c.context.internalAdapter.linkAccount({
1397
+ await c2.context.internalAdapter.linkAccount({
1383
1398
  providerId: provider.id,
1384
1399
  accountId: user.id.toString(),
1385
1400
  id: `${provider.id}:${user.id}`,
@@ -1388,14 +1403,14 @@ var callbackOAuth = createAuthEndpoint(
1388
1403
  });
1389
1404
  } catch (e) {
1390
1405
  console.log(e);
1391
- throw c.redirect(
1392
- `${c.context.baseURL}/error?error=failed_linking_account`
1406
+ throw c2.redirect(
1407
+ `${c2.context.baseURL}/error?error=failed_linking_account`
1393
1408
  );
1394
1409
  }
1395
1410
  }
1396
1411
  } else {
1397
1412
  try {
1398
- await c.context.internalAdapter.createOAuthUser(data.data, {
1413
+ await c2.context.internalAdapter.createOAuthUser(data.data, {
1399
1414
  ...getAccountTokens(tokens),
1400
1415
  id: `${provider.id}:${user.id}`,
1401
1416
  providerId: provider.id,
@@ -1405,8 +1420,8 @@ var callbackOAuth = createAuthEndpoint(
1405
1420
  } catch (e) {
1406
1421
  const url = new URL(currentURL || callbackURL);
1407
1422
  url.searchParams.set("error", "unable_to_create_user");
1408
- c.setHeader("Location", url.toString());
1409
- throw c.redirect(url.toString());
1423
+ c2.setHeader("Location", url.toString());
1424
+ throw c2.redirect(url.toString());
1410
1425
  }
1411
1426
  }
1412
1427
  if (!userId && !id)
@@ -1414,29 +1429,29 @@ var callbackOAuth = createAuthEndpoint(
1414
1429
  message: "Unable to create user"
1415
1430
  });
1416
1431
  try {
1417
- const session = await c.context.internalAdapter.createSession(
1432
+ const session = await c2.context.internalAdapter.createSession(
1418
1433
  userId || id,
1419
- c.request
1434
+ c2.request
1420
1435
  );
1421
1436
  if (!session) {
1422
1437
  const url = new URL(currentURL || callbackURL);
1423
1438
  url.searchParams.set("error", "unable_to_create_session");
1424
- throw c.redirect(url.toString());
1439
+ throw c2.redirect(url.toString());
1425
1440
  }
1426
1441
  try {
1427
- await setSessionCookie(c, session.id);
1442
+ await setSessionCookie(c2, session.id);
1428
1443
  } catch (e) {
1429
- c.context.logger.error("Unable to set session cookie", e);
1444
+ c2.context.logger.error("Unable to set session cookie", e);
1430
1445
  const url = new URL(currentURL || callbackURL);
1431
1446
  url.searchParams.set("error", "unable_to_create_session");
1432
- throw c.redirect(url.toString());
1447
+ throw c2.redirect(url.toString());
1433
1448
  }
1434
1449
  } catch {
1435
1450
  const url = new URL(currentURL || callbackURL || "");
1436
1451
  url.searchParams.set("error", "unable_to_create_session");
1437
- throw c.redirect(url.toString());
1452
+ throw c2.redirect(url.toString());
1438
1453
  }
1439
- throw c.redirect(callbackURL);
1454
+ throw c2.redirect(callbackURL);
1440
1455
  }
1441
1456
  );
1442
1457
 
@@ -1508,7 +1523,9 @@ var forgetPassword = createAuthEndpoint(
1508
1523
  });
1509
1524
  }
1510
1525
  const { email } = ctx.body;
1511
- const user = await ctx.context.internalAdapter.findUserByEmail(email);
1526
+ const user = await ctx.context.internalAdapter.findUserByEmail(email, {
1527
+ includeAccounts: true
1528
+ });
1512
1529
  if (!user) {
1513
1530
  ctx.context.logger.error("Reset Password: User not found", { email });
1514
1531
  return ctx.json(
@@ -1708,11 +1725,17 @@ var sendVerificationEmail = createAuthEndpoint(
1708
1725
  });
1709
1726
  }
1710
1727
  const { email } = ctx.body;
1728
+ const user = await ctx.context.internalAdapter.findUserByEmail(email);
1729
+ if (!user) {
1730
+ throw new APIError6("BAD_REQUEST", {
1731
+ message: "User not found"
1732
+ });
1733
+ }
1711
1734
  const token = await createEmailVerificationToken(ctx.context.secret, email);
1712
1735
  const url = `${ctx.context.baseURL}/verify-email?token=${token}&callbackURL=${ctx.body.callbackURL || ctx.query?.currentURL || "/"}`;
1713
1736
  await ctx.context.options.emailAndPassword.sendVerificationEmail(
1714
- email,
1715
1737
  url,
1738
+ user.user,
1716
1739
  token
1717
1740
  );
1718
1741
  return ctx.json({
@@ -1736,12 +1759,8 @@ var verifyEmail = createAuthEndpoint(
1736
1759
  jwt = await validateJWT2("HS256", Buffer.from(ctx.context.secret), token);
1737
1760
  } catch (e) {
1738
1761
  ctx.context.logger.error("Failed to verify email", e);
1739
- return ctx.json(null, {
1740
- status: 400,
1741
- statusText: "INVALID_TOKEN",
1742
- body: {
1743
- message: "Invalid token"
1744
- }
1762
+ throw new APIError6("BAD_REQUEST", {
1763
+ message: "Invalid token"
1745
1764
  });
1746
1765
  }
1747
1766
  const schema = z8.object({
@@ -1749,20 +1768,19 @@ var verifyEmail = createAuthEndpoint(
1749
1768
  });
1750
1769
  const parsed = schema.parse(jwt.payload);
1751
1770
  const user = await ctx.context.internalAdapter.findUserByEmail(
1752
- parsed.email
1771
+ parsed.email,
1772
+ { includeAccounts: true }
1753
1773
  );
1754
1774
  if (!user) {
1755
- return ctx.json(null, {
1756
- status: 400,
1757
- statusText: "USER_NOT_FOUND",
1758
- body: {
1759
- message: "User not found"
1760
- }
1775
+ throw new APIError6("BAD_REQUEST", {
1776
+ message: "User not found"
1761
1777
  });
1762
1778
  }
1763
1779
  const account = user.accounts.find((a) => a.providerId === "credential");
1764
1780
  if (!account) {
1765
- throw ctx.redirect;
1781
+ throw new APIError6("BAD_REQUEST", {
1782
+ message: "Account not found"
1783
+ });
1766
1784
  }
1767
1785
  await ctx.context.internalAdapter.updateUserByEmail(parsed.email, {
1768
1786
  emailVerified: true
@@ -2137,8 +2155,8 @@ var error = createAuthEndpoint(
2137
2155
  method: "GET",
2138
2156
  metadata: HIDE_METADATA
2139
2157
  },
2140
- async (c) => {
2141
- const query = new URL(c.request?.url || "").searchParams.get("error") || "Unknown";
2158
+ async (c2) => {
2159
+ const query = new URL(c2.request?.url || "").searchParams.get("error") || "Unknown";
2142
2160
  return new Response(html(query), {
2143
2161
  headers: {
2144
2162
  "Content-Type": "text/html"
@@ -2226,11 +2244,11 @@ var signUpEmail = () => createAuthEndpoint(
2226
2244
  }
2227
2245
  const hash = await ctx.context.password.hash(password);
2228
2246
  await ctx.context.internalAdapter.linkAccount({
2229
- id: generateRandomString(32, alphabet("a-z", "0-9", "A-Z")),
2230
2247
  userId: createdUser.id,
2231
2248
  providerId: "credential",
2232
2249
  accountId: createdUser.id,
2233
- password: hash
2250
+ password: hash,
2251
+ expiresAt: getDate(60 * 60 * 24 * 30, "sec")
2234
2252
  });
2235
2253
  const session = await ctx.context.internalAdapter.createSession(
2236
2254
  createdUser.id,
@@ -2249,8 +2267,8 @@ var signUpEmail = () => createAuthEndpoint(
2249
2267
  );
2250
2268
  const url = `${ctx.context.baseURL}/verify-email?token=${token}&callbackURL=${body.callbackURL || ctx.query?.currentURL || "/"}`;
2251
2269
  await ctx.context.options.emailAndPassword.sendVerificationEmail?.(
2252
- createdUser.email,
2253
2270
  url,
2271
+ createdUser,
2254
2272
  token
2255
2273
  );
2256
2274
  }
@@ -5475,30 +5493,31 @@ var bearer = () => {
5475
5493
  context.request?.headers.get("authorization") || context.headers?.get("authorization")
5476
5494
  );
5477
5495
  },
5478
- handler: async (c) => {
5479
- const token = c.request?.headers.get("authorization")?.replace("Bearer ", "") || c.headers?.get("authorization")?.replace("Bearer ", "");
5496
+ handler: async (c2) => {
5497
+ const token = c2.request?.headers.get("authorization")?.replace("Bearer ", "") || c2.headers?.get("authorization")?.replace("Bearer ", "");
5480
5498
  if (!token) {
5481
5499
  return;
5482
5500
  }
5483
- const signedToken = await serializeSigned(
5484
- "",
5485
- token,
5486
- c.context.secret
5487
- );
5488
- if (c.request) {
5489
- c.request.headers.set(
5501
+ let signedToken = "";
5502
+ if (token.includes(".")) {
5503
+ signedToken = token.split(".")[1];
5504
+ } else {
5505
+ signedToken = await serializeSigned("", token, c2.context.secret);
5506
+ }
5507
+ if (c2.request) {
5508
+ c2.request.headers.set(
5490
5509
  "cookie",
5491
- `${c.context.authCookies.sessionToken.name}=${signedToken.replace("=", "")}`
5510
+ `${c2.context.authCookies.sessionToken.name}=${signedToken.replace("=", "")}`
5492
5511
  );
5493
5512
  }
5494
- if (c.headers) {
5495
- c.headers.set(
5513
+ if (c2.headers) {
5514
+ c2.headers.set(
5496
5515
  "cookie",
5497
- `${c.context.authCookies.sessionToken.name}=${signedToken.replace("=", "")}`
5516
+ `${c2.context.authCookies.sessionToken.name}=${signedToken.replace("=", "")}`
5498
5517
  );
5499
5518
  }
5500
5519
  return {
5501
- context: c
5520
+ context: c2
5502
5521
  };
5503
5522
  }
5504
5523
  }
@@ -6142,13 +6161,28 @@ var adminMiddleware = createAuthMiddleware(async (ctx) => {
6142
6161
  }
6143
6162
  };
6144
6163
  });
6145
- var admin = () => {
6164
+ var admin = (options) => {
6146
6165
  return {
6147
6166
  id: "admin",
6148
6167
  init(ctx) {
6149
6168
  return {
6150
6169
  options: {
6151
6170
  databaseHooks: {
6171
+ user: {
6172
+ create: {
6173
+ async before(user) {
6174
+ if (options?.defaultRole === false) {
6175
+ return;
6176
+ }
6177
+ return {
6178
+ data: {
6179
+ role: options?.defaultRole ?? "user",
6180
+ ...user
6181
+ }
6182
+ };
6183
+ }
6184
+ }
6185
+ },
6152
6186
  session: {
6153
6187
  create: {
6154
6188
  async before(session) {
@@ -6364,8 +6398,8 @@ var admin = () => {
6364
6398
  ctx.body.userId,
6365
6399
  {
6366
6400
  banned: true,
6367
- banReason: ctx.body.banReason,
6368
- banExpires: ctx.body.banExpiresIn ? Date.now() + ctx.body.banExpiresIn * 1e3 : void 0
6401
+ banReason: ctx.body.banReason || options?.defaultBanReason || "No reason",
6402
+ banExpires: ctx.body.banExpiresIn ? Date.now() + ctx.body.banExpiresIn * 1e3 : options?.defaultBanExpiresIn ? Date.now() + options.defaultBanExpiresIn * 1e3 : void 0
6369
6403
  }
6370
6404
  );
6371
6405
  await ctx.context.internalAdapter.deleteSessions(ctx.body.userId);
@@ -6397,7 +6431,9 @@ var admin = () => {
6397
6431
  void 0,
6398
6432
  true,
6399
6433
  {
6400
- impersonatedBy: ctx.context.session.user.id
6434
+ impersonatedBy: ctx.context.session.user.id,
6435
+ expiresAt: options?.impersonationSessionDuration ? getDate(options.impersonationSessionDuration, "sec") : getDate(60 * 60, "sec")
6436
+ // 1 hour
6401
6437
  }
6402
6438
  );
6403
6439
  if (!session) {
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-Bt0CUdx4.js';
6
+ import './index-B5SM-JCa.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-Bt0CUdx4.js';
1
+ import { a as Auth } from './index-B5SM-JCa.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-Bt0CUdx4.js';
6
+ import './index-B5SM-JCa.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-Bt0CUdx4.js';
1
+ import { a as Auth, B as BetterAuthOptions } from './index-B5SM-JCa.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-Bt0CUdx4.js';
6
+ import './index-B5SM-JCa.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-Bt0CUdx4.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-Bt0CUdx4.js';
1
+ import { b as BetterAuthPlugin, a as Auth, I as InferFieldsInputClient, h as InferFieldsOutput } from './index-B5SM-JCa.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-B5SM-JCa.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-Bt0CUdx4.js';
6
+ import './index-B5SM-JCa.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.4",
3
+ "version": "0.4.5",
4
4
  "description": "The most comprehensive authentication library for TypeScript.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",