@better-auth/core 1.6.9 → 1.6.10

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.
@@ -2,7 +2,7 @@
2
2
  const symbol = Symbol.for("better-auth:global");
3
3
  let bind = null;
4
4
  const __context = {};
5
- const __betterAuthVersion = "1.6.9";
5
+ const __betterAuthVersion = "1.6.10";
6
6
  /**
7
7
  * We store context instance in the globalThis.
8
8
  *
@@ -2,7 +2,7 @@ import { ATTR_HTTP_RESPONSE_STATUS_CODE } from "./attributes.mjs";
2
2
  import { getOpenTelemetryAPI } from "./api.mjs";
3
3
  //#region src/instrumentation/tracer.ts
4
4
  const INSTRUMENTATION_SCOPE = "better-auth";
5
- const INSTRUMENTATION_VERSION = "1.6.9";
5
+ const INSTRUMENTATION_VERSION = "1.6.10";
6
6
  /**
7
7
  * Better-auth uses `throw ctx.redirect(url)` for flow control (e.g. OAuth
8
8
  * callbacks). These are APIErrors with 3xx status codes and should not be
@@ -83,7 +83,12 @@ interface InternalAdapter<_Options extends BetterAuthOptions = BetterAuthOptions
83
83
  updateSession(sessionToken: string, session: Partial<Session> & Record<string, any>): Promise<Session | null>;
84
84
  deleteSession(token: string): Promise<void>;
85
85
  deleteAccounts(userId: string): Promise<void>;
86
- deleteAccount(accountId: string): Promise<void>;
86
+ /**
87
+ * Delete an account by its primary key.
88
+ *
89
+ * @param id - The account row's primary key (the `id` column, not the `accountId` column).
90
+ */
91
+ deleteAccount(id: string): Promise<void>;
87
92
  deleteSessions(userIdOrSessionTokens: string | string[]): Promise<void>;
88
93
  findOAuthUser(email: string, accountId: string, providerId: string): Promise<{
89
94
  user: User;
@@ -110,6 +115,7 @@ interface InternalAdapter<_Options extends BetterAuthOptions = BetterAuthOptions
110
115
  findVerificationValue(identifier: string): Promise<Verification | null>;
111
116
  deleteVerificationByIdentifier(identifier: string): Promise<void>;
112
117
  updateVerificationByIdentifier(identifier: string, data: Partial<Verification>): Promise<Verification>;
118
+ refreshUserSessions(user: User): Promise<void>;
113
119
  }
114
120
  type CreateCookieGetterFn = (cookieName: string, overrideAttributes?: Partial<CookieOptions> | undefined) => BetterAuthCookie;
115
121
  type CheckPasswordFn<Options extends BetterAuthOptions = BetterAuthOptions> = (userId: string, ctx: GenericEndpointContext<Options>) => Promise<boolean>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@better-auth/core",
3
- "version": "1.6.9",
3
+ "version": "1.6.10",
4
4
  "description": "The most comprehensive authentication framework for TypeScript.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -97,7 +97,7 @@
97
97
  "deno": "./dist/instrumentation/index.mjs",
98
98
  "bun": "./dist/instrumentation/index.mjs",
99
99
  "edge": "./dist/instrumentation/pure.index.mjs",
100
- "workerd": "./dist/instrumentation/index.mjs",
100
+ "workerd": "./dist/instrumentation/pure.index.mjs",
101
101
  "browser": "./dist/instrumentation/pure.index.mjs",
102
102
  "default": "./dist/instrumentation/index.mjs"
103
103
  }
@@ -151,7 +151,12 @@ export interface InternalAdapter<
151
151
 
152
152
  deleteAccounts(userId: string): Promise<void>;
153
153
 
154
- deleteAccount(accountId: string): Promise<void>;
154
+ /**
155
+ * Delete an account by its primary key.
156
+ *
157
+ * @param id - The account row's primary key (the `id` column, not the `accountId` column).
158
+ */
159
+ deleteAccount(id: string): Promise<void>;
155
160
 
156
161
  deleteSessions(userIdOrSessionTokens: string | string[]): Promise<void>;
157
162
 
@@ -215,6 +220,8 @@ export interface InternalAdapter<
215
220
  identifier: string,
216
221
  data: Partial<Verification>,
217
222
  ): Promise<Verification>;
223
+
224
+ refreshUserSessions(user: User): Promise<void>;
218
225
  }
219
226
 
220
227
  type CreateCookieGetterFn = (