@better-auth/electron 1.6.19 → 1.6.21

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/client.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { t as PACKAGE_VERSION } from "./version-BBOVUjFi.mjs";
1
+ import { t as PACKAGE_VERSION } from "./version-CSXTsU_C.mjs";
2
2
  import { n as isProcessType, r as parseProtocolScheme, t as getChannelPrefixWithDelimiter } from "./utils-DxDKRT6e.mjs";
3
3
  import { BetterAuthError } from "@better-auth/core/error";
4
4
  import { base64, base64Url } from "@better-auth/utils/base64";
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { t as PACKAGE_VERSION } from "./version-BBOVUjFi.mjs";
1
+ import { t as PACKAGE_VERSION } from "./version-CSXTsU_C.mjs";
2
2
  import { createAuthMiddleware } from "@better-auth/core/api";
3
3
  import { APIError, BASE_ERROR_CODES } from "@better-auth/core/error";
4
4
  import { base64Url } from "@better-auth/utils/base64";
@@ -404,8 +404,14 @@ type DBAdapter<Options extends BetterAuthOptions = BetterAuthOptions> = {
404
404
  where?: Where[] | undefined;
405
405
  }) => Promise<number>;
406
406
  /**
407
- * ⚠︎ Update may not return the updated data
408
- * if multiple where clauses are provided
407
+ * Update a single row matching the where clause.
408
+ *
409
+ * Returns the updated row, or `null` when no row matched. Empty `where`
410
+ * clauses return `null`; use `updateMany` for intentional bulk updates.
411
+ *
412
+ * This is not the race-safe primitive for guarded state transitions. Use
413
+ * `incrementOne` when the predicate is both selector and guard, and use
414
+ * `consumeOne` for single-use destructive reads.
409
415
  */
410
416
  update: <T>(data: {
411
417
  model: string;
@@ -1347,8 +1353,8 @@ interface GoogleOptions extends ProviderOptions<GoogleProfile> {
1347
1353
  *
1348
1354
  * This is sent to Google as the `hd` authorization hint and, when set, is
1349
1355
  * also enforced against the `hd` claim of the returned id token/profile.
1350
- * Sign-in is rejected when the claim is missing or does not match, so this
1351
- * can be used to restrict sign-in to a Workspace domain.
1356
+ * Set `hd: "*"` to require any Workspace hosted-domain claim. Sign-in is
1357
+ * rejected when the claim is missing or does not satisfy this restriction.
1352
1358
  */
1353
1359
  hd?: string | undefined;
1354
1360
  }
@@ -2068,6 +2074,7 @@ interface PaybinOptions extends ProviderOptions<PaybinProfile> {
2068
2074
  //#region ../core/dist/social-providers/paypal.d.mts
2069
2075
  //#region src/social-providers/paypal.d.ts
2070
2076
  interface PayPalProfile {
2077
+ sub?: string | undefined;
2071
2078
  user_id: string;
2072
2079
  name: string;
2073
2080
  given_name: string;
@@ -4031,14 +4038,14 @@ type BaseAccount = z.infer<typeof accountSchema>;
4031
4038
  */
4032
4039
  type Account<DBOptions extends BetterAuthOptions["account"] = BetterAuthOptions["account"], Plugins extends BetterAuthOptions["plugins"] = BetterAuthOptions["plugins"]> = Prettify$1<BaseAccount & InferDBFieldsFromOptions<DBOptions> & InferDBFieldsFromPlugins<"account", Plugins>>; //#endregion
4033
4040
  //#endregion
4034
- //#region ../../node_modules/.pnpm/better-call@1.3.6_zod@4.3.6/node_modules/better-call/dist/helper.d.mts
4041
+ //#region ../../node_modules/.pnpm/better-call@1.3.7_zod@4.3.6/node_modules/better-call/dist/helper.d.mts
4035
4042
  type Prettify<T> = { [K in keyof T]: T[K] } & {};
4036
4043
  type IsEmptyObject<T> = keyof T extends never ? true : false;
4037
4044
  type UnionToIntersection<Union> = (Union extends unknown ? (distributedUnion: Union) => void : never) extends ((mergedIntersection: infer Intersection) => void) ? Intersection & Union : never;
4038
4045
  type InferParamPath<Path> = Path extends `${infer _Start}:${infer Param}/${infer Rest}` ? { [K in Param | keyof InferParamPath<Rest>]: string } : Path extends `${infer _Start}:${infer Param}` ? { [K in Param]: string } : Path extends `${infer _Start}/${infer Rest}` ? InferParamPath<Rest> : {};
4039
4046
  type InferParamWildCard<Path> = Path extends `${infer _Start}/*:${infer Param}/${infer Rest}` | `${infer _Start}/**:${infer Param}/${infer Rest}` ? { [K in Param | keyof InferParamPath<Rest>]: string } : Path extends `${infer _Start}/*` ? { [K in "_"]: string } : Path extends `${infer _Start}/${infer Rest}` ? InferParamWildCard<Rest> : {}; //#endregion
4040
4047
  //#endregion
4041
- //#region ../../node_modules/.pnpm/better-call@1.3.6_zod@4.3.6/node_modules/better-call/dist/standard-schema.d.mts
4048
+ //#region ../../node_modules/.pnpm/better-call@1.3.7_zod@4.3.6/node_modules/better-call/dist/standard-schema.d.mts
4042
4049
  //#region src/standard-schema.d.ts
4043
4050
  /** The Standard Schema interface. */
4044
4051
  interface StandardSchemaV1$1<Input = unknown, Output = Input> {
@@ -4096,7 +4103,7 @@ declare namespace StandardSchemaV1$1 {
4096
4103
  type InferOutput<Schema extends StandardSchemaV1$1> = NonNullable<Schema["~standard"]["types"]>["output"];
4097
4104
  } //#endregion
4098
4105
  //#endregion
4099
- //#region ../../node_modules/.pnpm/better-call@1.3.6_zod@4.3.6/node_modules/better-call/dist/error.d.mts
4106
+ //#region ../../node_modules/.pnpm/better-call@1.3.7_zod@4.3.6/node_modules/better-call/dist/error.d.mts
4100
4107
  declare const statusCodes: {
4101
4108
  OK: number;
4102
4109
  CREATED: number;
@@ -4174,7 +4181,7 @@ declare const APIError: new (status?: Status | "OK" | "CREATED" | "ACCEPTED" | "
4174
4181
  errorStack: string | undefined;
4175
4182
  }; //#endregion
4176
4183
  //#endregion
4177
- //#region ../../node_modules/.pnpm/better-call@1.3.6_zod@4.3.6/node_modules/better-call/dist/cookies.d.mts
4184
+ //#region ../../node_modules/.pnpm/better-call@1.3.7_zod@4.3.6/node_modules/better-call/dist/cookies.d.mts
4178
4185
  //#region src/cookies.d.ts
4179
4186
  type CookiePrefixOptions = "host" | "secure";
4180
4187
  type CookieOptions = {
@@ -4264,7 +4271,7 @@ type CookieOptions = {
4264
4271
  prefix?: CookiePrefixOptions;
4265
4272
  };
4266
4273
  //#endregion
4267
- //#region ../../node_modules/.pnpm/better-call@1.3.6_zod@4.3.6/node_modules/better-call/dist/openapi.d.mts
4274
+ //#region ../../node_modules/.pnpm/better-call@1.3.7_zod@4.3.6/node_modules/better-call/dist/openapi.d.mts
4268
4275
  //#region src/openapi.d.ts
4269
4276
  type OpenAPISchemaType = "string" | "number" | "integer" | "boolean" | "array" | "object";
4270
4277
  interface OpenAPIParameter {
@@ -4286,7 +4293,7 @@ interface OpenAPIParameter {
4286
4293
  };
4287
4294
  }
4288
4295
  //#endregion
4289
- //#region ../../node_modules/.pnpm/better-call@1.3.6_zod@4.3.6/node_modules/better-call/dist/endpoint.d.mts
4296
+ //#region ../../node_modules/.pnpm/better-call@1.3.7_zod@4.3.6/node_modules/better-call/dist/endpoint.d.mts
4290
4297
  //#region src/endpoint.d.ts
4291
4298
  interface EndpointBaseOptions {
4292
4299
  /**
@@ -4665,7 +4672,7 @@ type Endpoint<Path extends string = string, Options extends EndpointOptions = En
4665
4672
  path: Path;
4666
4673
  }; //#endregion
4667
4674
  //#endregion
4668
- //#region ../../node_modules/.pnpm/better-call@1.3.6_zod@4.3.6/node_modules/better-call/dist/middleware.d.mts
4675
+ //#region ../../node_modules/.pnpm/better-call@1.3.7_zod@4.3.6/node_modules/better-call/dist/middleware.d.mts
4669
4676
  //#region src/middleware.d.ts
4670
4677
  interface MiddlewareOptions extends Omit<EndpointOptions, "method"> {}
4671
4678
  type MiddlewareContext<Options extends MiddlewareOptions, Context = {}> = EndpointContext<string, Options & {
@@ -4772,7 +4779,7 @@ type Middleware<Options extends MiddlewareOptions = MiddlewareOptions, Handler e
4772
4779
  options: Options;
4773
4780
  }; //#endregion
4774
4781
  //#endregion
4775
- //#region ../../node_modules/.pnpm/better-call@1.3.6_zod@4.3.6/node_modules/better-call/dist/context.d.mts
4782
+ //#region ../../node_modules/.pnpm/better-call@1.3.7_zod@4.3.6/node_modules/better-call/dist/context.d.mts
4776
4783
  //#region src/context.d.ts
4777
4784
  type HTTPMethod = "GET" | "POST" | "PUT" | "DELETE" | "PATCH";
4778
4785
  type Method = HTTPMethod | "*";
@@ -5593,7 +5600,7 @@ type BetterAuthAdvancedOptions = {
5593
5600
  * @example ["x-client-ip", "x-forwarded-for", "cf-connecting-ip"]
5594
5601
  *
5595
5602
  * @default
5596
- * @link https://github.com/better-auth/better-auth/blob/main/packages/better-auth/src/utils/get-request-ip.ts#L8
5603
+ * @link https://github.com/better-auth/better-auth/blob/main/packages/core/src/utils/ip.ts
5597
5604
  */
5598
5605
  ipAddressHeaders?: string[];
5599
5606
  /**
@@ -5610,6 +5617,21 @@ type BetterAuthAdvancedOptions = {
5610
5617
  * @default 64
5611
5618
  */
5612
5619
  ipv6Subnet?: number;
5620
+ /**
5621
+ * Trusted reverse-proxy IPs or CIDR ranges. When set, a forwarded IP
5622
+ * chain is walked right to left, trusted hops are skipped, and the
5623
+ * first untrusted address is the client IP. Unset trusts only
5624
+ * single-value IP headers. Use the actual address or subnet of your
5625
+ * proxies, not a broad private range that also covers clients.
5626
+ *
5627
+ * This only interprets the forwarded header chain and cannot verify
5628
+ * the direct sender. It is safe only when your origin is reachable
5629
+ * through these proxies and clients cannot set forwarded headers
5630
+ * directly.
5631
+ *
5632
+ * @example ["192.0.2.10", "10.0.0.0/24"]
5633
+ */
5634
+ trustedProxies?: string[];
5613
5635
  } | undefined;
5614
5636
  /**
5615
5637
  * Force cookies to always use the `Secure` attribute. By default,
package/dist/preload.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import electron, { contextBridge } from "electron";
2
- //#region ../../node_modules/.pnpm/better-call@1.3.6_zod@4.3.6/node_modules/better-call/dist/error.mjs
2
+ //#region ../../node_modules/.pnpm/better-call@1.3.7_zod@4.3.6/node_modules/better-call/dist/error.mjs
3
3
  function isErrorStackTraceLimitWritable() {
4
4
  const desc = Object.getOwnPropertyDescriptor(Error, "stackTraceLimit");
5
5
  if (desc === void 0) return Object.isExtensible(Error);
package/dist/proxy.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { t as PACKAGE_VERSION } from "./version-BBOVUjFi.mjs";
1
+ import { t as PACKAGE_VERSION } from "./version-CSXTsU_C.mjs";
2
2
  import { r as parseProtocolScheme } from "./utils-DxDKRT6e.mjs";
3
3
  import { parseCookies } from "better-auth/cookies";
4
4
  //#region src/proxy.ts
@@ -1,5 +1,5 @@
1
1
  //#endregion
2
2
  //#region src/version.ts
3
- const PACKAGE_VERSION = "1.6.19";
3
+ const PACKAGE_VERSION = "1.6.21";
4
4
  //#endregion
5
5
  export { PACKAGE_VERSION as t };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@better-auth/electron",
3
- "version": "1.6.19",
3
+ "version": "1.6.21",
4
4
  "description": "Better Auth integration for Electron applications.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -80,17 +80,17 @@
80
80
  "better-sqlite3": "^12.6.2",
81
81
  "electron": "^41.2.2",
82
82
  "tsdown": "0.21.1",
83
- "@better-auth/core": "1.6.19",
84
- "better-auth": "1.6.19"
83
+ "@better-auth/core": "1.6.21",
84
+ "better-auth": "1.6.21"
85
85
  },
86
86
  "peerDependencies": {
87
87
  "@better-auth/utils": "0.4.2",
88
88
  "@better-fetch/fetch": "1.3.1",
89
- "better-call": "1.3.6",
89
+ "better-call": "1.3.7",
90
90
  "conf": "^15.0.2",
91
91
  "electron": ">=36.0.0",
92
- "@better-auth/core": "^1.6.19",
93
- "better-auth": "^1.6.19"
92
+ "@better-auth/core": "^1.6.21",
93
+ "better-auth": "^1.6.21"
94
94
  },
95
95
  "peerDependenciesMeta": {
96
96
  "electron": {