better-auth 1.6.4 → 1.6.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.
@@ -67,7 +67,7 @@ const getClientConfig = (options, loadEnv) => {
67
67
  const atomListeners = [{
68
68
  signal: "$sessionSignal",
69
69
  matcher(path) {
70
- return path === "/sign-out" || path === "/update-user" || path === "/update-session" || path === "/sign-up/email" || path === "/sign-in/email" || path === "/delete-user" || path === "/verify-email" || path === "/revoke-sessions" || path === "/revoke-session" || path === "/change-email";
70
+ return path === "/sign-out" || path === "/update-user" || path === "/update-session" || path === "/sign-up/email" || path === "/sign-in/email" || path === "/delete-user" || path === "/verify-email" || path === "/revoke-sessions" || path === "/revoke-session" || path === "/revoke-other-sessions" || path === "/change-email" || path === "/change-password";
71
71
  },
72
72
  callback(path) {
73
73
  if (path === "/sign-out") broadcastSessionUpdate("signout");
package/dist/package.mjs CHANGED
@@ -1,4 +1,4 @@
1
1
  //#region package.json
2
- var version = "1.6.4";
2
+ var version = "1.6.5";
3
3
  //#endregion
4
4
  export { version };
@@ -18,19 +18,28 @@ declare module "@better-auth/core" {
18
18
  * - Auth helpers (login, getAuthHeaders, getCookies)
19
19
  * - OTP capture (when captureOTP: true)
20
20
  *
21
+ * This plugin does not register public HTTP routes or API endpoints, but it does
22
+ * expose privileged helpers on `ctx.test` for creating sessions and mutating data.
23
+ * Prefer including it in a test-only auth instance such as `auth.test.ts` instead
24
+ * of a production auth config.
25
+ *
26
+ * If you conditionally spread it into `plugins`, TypeScript may stop inferring
27
+ * `ctx.test` correctly. A separate test-only auth instance keeps the helpers
28
+ * typed without adding the plugin to your production auth config.
29
+ *
21
30
  * @example
22
31
  * ```ts
23
32
  * import { betterAuth } from "better-auth";
24
33
  * import { testUtils } from "better-auth/plugins";
25
34
  *
26
- * export const auth = betterAuth({
35
+ * export const testAuth = betterAuth({
27
36
  * plugins: [
28
37
  * testUtils({ captureOTP: true }),
29
38
  * ],
30
39
  * });
31
40
  *
32
41
  * // In tests, access helpers via context:
33
- * const ctx = await auth.$context;
42
+ * const ctx = await testAuth.$context;
34
43
  * const test = ctx.test;
35
44
  *
36
45
  * const user = test.createUser({ email: "test@example.com" });
@@ -13,19 +13,28 @@ import { createOTPStore } from "./otp-sink.mjs";
13
13
  * - Auth helpers (login, getAuthHeaders, getCookies)
14
14
  * - OTP capture (when captureOTP: true)
15
15
  *
16
+ * This plugin does not register public HTTP routes or API endpoints, but it does
17
+ * expose privileged helpers on `ctx.test` for creating sessions and mutating data.
18
+ * Prefer including it in a test-only auth instance such as `auth.test.ts` instead
19
+ * of a production auth config.
20
+ *
21
+ * If you conditionally spread it into `plugins`, TypeScript may stop inferring
22
+ * `ctx.test` correctly. A separate test-only auth instance keeps the helpers
23
+ * typed without adding the plugin to your production auth config.
24
+ *
16
25
  * @example
17
26
  * ```ts
18
27
  * import { betterAuth } from "better-auth";
19
28
  * import { testUtils } from "better-auth/plugins";
20
29
  *
21
- * export const auth = betterAuth({
30
+ * export const testAuth = betterAuth({
22
31
  * plugins: [
23
32
  * testUtils({ captureOTP: true }),
24
33
  * ],
25
34
  * });
26
35
  *
27
36
  * // In tests, access helpers via context:
28
- * const ctx = await auth.$context;
37
+ * const ctx = await testAuth.$context;
29
38
  * const test = ctx.test;
30
39
  *
31
40
  * const user = test.createUser({ email: "test@example.com" });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "better-auth",
3
- "version": "1.6.4",
3
+ "version": "1.6.5",
4
4
  "description": "The most comprehensive authentication framework for TypeScript.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -489,13 +489,13 @@
489
489
  "kysely": "^0.28.14",
490
490
  "nanostores": "^1.1.1",
491
491
  "zod": "^4.3.6",
492
- "@better-auth/core": "1.6.4",
493
- "@better-auth/drizzle-adapter": "1.6.4",
494
- "@better-auth/kysely-adapter": "1.6.4",
495
- "@better-auth/memory-adapter": "1.6.4",
496
- "@better-auth/mongo-adapter": "1.6.4",
497
- "@better-auth/prisma-adapter": "1.6.4",
498
- "@better-auth/telemetry": "1.6.4"
492
+ "@better-auth/core": "1.6.5",
493
+ "@better-auth/drizzle-adapter": "1.6.5",
494
+ "@better-auth/kysely-adapter": "1.6.5",
495
+ "@better-auth/memory-adapter": "1.6.5",
496
+ "@better-auth/mongo-adapter": "1.6.5",
497
+ "@better-auth/prisma-adapter": "1.6.5",
498
+ "@better-auth/telemetry": "1.6.5"
499
499
  },
500
500
  "devDependencies": {
501
501
  "@lynx-js/react": "^0.116.3",