@better-auth/api-key 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.
package/dist/client.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { n as API_KEY_ERROR_CODES, t as PACKAGE_VERSION } from "./version-BmYkj6dl.mjs";
1
+ import { n as API_KEY_ERROR_CODES, t as PACKAGE_VERSION } from "./version-Cn2i9Ywe.mjs";
2
2
  //#region src/client.ts
3
3
  const apiKeyClient = () => {
4
4
  return {
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { n as API_KEY_ERROR_CODES, t as PACKAGE_VERSION } from "./version-BmYkj6dl.mjs";
1
+ import { n as API_KEY_ERROR_CODES, t as PACKAGE_VERSION } from "./version-Cn2i9Ywe.mjs";
2
2
  import { createAuthEndpoint, createAuthMiddleware } from "@better-auth/core/api";
3
3
  import { base64Url } from "@better-auth/utils/base64";
4
4
  import { createHash } from "@better-auth/utils/hash";
@@ -1635,6 +1635,7 @@ function isRateLimited(apiKey, opts) {
1635
1635
  async function validateApiKey({ hashedKey, ctx, opts, schema, permissions }) {
1636
1636
  const apiKey = await getApiKey$1(ctx, hashedKey, opts);
1637
1637
  if (!apiKey) throw APIError$1.from("UNAUTHORIZED", API_KEY_ERROR_CODES.INVALID_API_KEY);
1638
+ if (apiKey.configId !== (opts.configId ?? "default")) throw APIError$1.from("UNAUTHORIZED", API_KEY_ERROR_CODES.INVALID_API_KEY);
1638
1639
  if (apiKey.enabled === false) throw APIError$1.from("UNAUTHORIZED", API_KEY_ERROR_CODES.KEY_DISABLED);
1639
1640
  if (apiKey.expiresAt) {
1640
1641
  if (Date.now() > new Date(apiKey.expiresAt).getTime()) {
@@ -35,6 +35,6 @@ const API_KEY_ERROR_CODES = defineErrorCodes({
35
35
  });
36
36
  //#endregion
37
37
  //#region src/version.ts
38
- const PACKAGE_VERSION = "1.6.9";
38
+ const PACKAGE_VERSION = "1.6.10";
39
39
  //#endregion
40
40
  export { API_KEY_ERROR_CODES as n, PACKAGE_VERSION as t };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@better-auth/api-key",
3
- "version": "1.6.9",
3
+ "version": "1.6.10",
4
4
  "description": "API Key plugin for Better Auth.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -61,13 +61,13 @@
61
61
  },
62
62
  "devDependencies": {
63
63
  "tsdown": "0.21.1",
64
- "@better-auth/core": "1.6.9",
65
- "better-auth": "1.6.9"
64
+ "@better-auth/core": "1.6.10",
65
+ "better-auth": "1.6.10"
66
66
  },
67
67
  "peerDependencies": {
68
68
  "@better-auth/utils": "0.4.0",
69
- "@better-auth/core": "^1.6.9",
70
- "better-auth": "^1.6.9"
69
+ "@better-auth/core": "^1.6.10",
70
+ "better-auth": "^1.6.10"
71
71
  },
72
72
  "scripts": {
73
73
  "build": "tsdown",