@better-auth/core 1.6.19 → 1.6.20

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.19";
5
+ const __betterAuthVersion = "1.6.20";
6
6
  /**
7
7
  * We store context instance in the globalThis.
8
8
  *
@@ -7,7 +7,14 @@ declare class BetterAuthError extends Error {
7
7
  cause?: unknown | undefined;
8
8
  });
9
9
  }
10
+ type BaseAPIErrorInstance = InstanceType<typeof APIError$1>;
10
11
  declare class APIError extends APIError$1 {
12
+ status: BaseAPIErrorInstance["status"];
13
+ body: BaseAPIErrorInstance["body"];
14
+ headers: BaseAPIErrorInstance["headers"];
15
+ statusCode: BaseAPIErrorInstance["statusCode"];
16
+ message: string;
17
+ errorStack: BaseAPIErrorInstance["errorStack"];
11
18
  constructor(...args: ConstructorParameters<typeof APIError$1>);
12
19
  static fromStatus(status: ConstructorParameters<typeof APIError$1>[0], body?: ConstructorParameters<typeof APIError$1>[1]): APIError;
13
20
  static from(status: ConstructorParameters<typeof APIError$1>[0], error: {
@@ -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.19";
5
+ const INSTRUMENTATION_VERSION = "1.6.20";
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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@better-auth/core",
3
- "version": "1.6.19",
3
+ "version": "1.6.20",
4
4
  "description": "The most comprehensive authentication framework for TypeScript.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -11,7 +11,16 @@ export class BetterAuthError extends Error {
11
11
 
12
12
  export { type APIErrorCode, BASE_ERROR_CODES } from "./codes";
13
13
 
14
+ type BaseAPIErrorInstance = InstanceType<typeof BaseAPIError>;
15
+
14
16
  export class APIError extends BaseAPIError {
17
+ declare status: BaseAPIErrorInstance["status"];
18
+ declare body: BaseAPIErrorInstance["body"];
19
+ declare headers: BaseAPIErrorInstance["headers"];
20
+ declare statusCode: BaseAPIErrorInstance["statusCode"];
21
+ declare message: string;
22
+ declare errorStack: BaseAPIErrorInstance["errorStack"];
23
+
15
24
  constructor(...args: ConstructorParameters<typeof BaseAPIError>) {
16
25
  super(...args);
17
26
  }