@better-auth/oauth-provider 1.6.6 → 1.6.7

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.
@@ -1,5 +1,5 @@
1
1
  import { a as getJwtPlugin, o as getOAuthProviderPlugin, y as handleMcpErrors } from "./utils-B9Pj9EPf.mjs";
2
- import { t as PACKAGE_VERSION } from "./version-A7ZA9idU.mjs";
2
+ import { t as PACKAGE_VERSION } from "./version-BWjL4z5q.mjs";
3
3
  import { verifyAccessToken } from "better-auth/oauth2";
4
4
  import { APIError } from "better-call";
5
5
  import { logger } from "@better-auth/core/env";
package/dist/client.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { t as PACKAGE_VERSION } from "./version-A7ZA9idU.mjs";
1
+ import { t as PACKAGE_VERSION } from "./version-BWjL4z5q.mjs";
2
2
  import { safeJSONParse } from "@better-auth/core/utils/json";
3
3
  //#region src/client.ts
4
4
  function parseSignedQuery(search) {
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { _ as validateClientCredentials, a as getJwtPlugin, b as mcpHandler, c as isPKCERequired, d as parsePrompt, f as resolveSessionAuthTime, g as storeToken, h as storeClientSecret, i as getClient, l as normalizeTimestampValue, m as searchParamsToQuery, n as decryptStoredClientSecret, p as resolveSubjectIdentifier, r as deleteFromPrompt, s as getStoredToken, t as basicToClientCredentials, u as parseClientMetadata, v as verifyOAuthQueryParams } from "./utils-B9Pj9EPf.mjs";
2
- import { t as PACKAGE_VERSION } from "./version-A7ZA9idU.mjs";
2
+ import { t as PACKAGE_VERSION } from "./version-BWjL4z5q.mjs";
3
3
  import { APIError, createAuthEndpoint, createAuthMiddleware, getOAuthState, getSessionFromCtx, sessionMiddleware } from "better-auth/api";
4
4
  import { generateCodeChallenge, getJwks, verifyJwsAccessToken } from "better-auth/oauth2";
5
5
  import { APIError as APIError$1 } from "better-call";
@@ -252,11 +252,7 @@ function userNormalClaims(user, scopes) {
252
252
  * Handles the /oauth2/userinfo endpoint
253
253
  */
254
254
  async function userInfoEndpoint(ctx, opts) {
255
- if (!ctx.request) throw new APIError("UNAUTHORIZED", {
256
- error_description: "request not found",
257
- error: "invalid_request"
258
- });
259
- const authorization = ctx.request.headers.get("authorization");
255
+ const authorization = ctx.headers?.get("authorization");
260
256
  const token = typeof authorization === "string" && authorization?.startsWith("Bearer ") ? authorization?.replace("Bearer ", "") : authorization;
261
257
  if (!token?.length) throw new APIError("UNAUTHORIZED", {
262
258
  error_description: "authorization header not found",
@@ -1,5 +1,5 @@
1
1
  //#endregion
2
2
  //#region src/version.ts
3
- const PACKAGE_VERSION = "1.6.6";
3
+ const PACKAGE_VERSION = "1.6.7";
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/oauth-provider",
3
- "version": "1.6.6",
3
+ "version": "1.6.7",
4
4
  "description": "An oauth provider plugin for Better Auth",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -64,15 +64,15 @@
64
64
  "@modelcontextprotocol/sdk": "^1.27.1",
65
65
  "listhen": "^1.9.0",
66
66
  "tsdown": "0.21.1",
67
- "better-auth": "1.6.6",
68
- "@better-auth/core": "1.6.6"
67
+ "@better-auth/core": "1.6.7",
68
+ "better-auth": "1.6.7"
69
69
  },
70
70
  "peerDependencies": {
71
71
  "@better-auth/utils": "0.4.0",
72
72
  "@better-fetch/fetch": "1.1.21",
73
73
  "better-call": "1.3.5",
74
- "@better-auth/core": "^1.6.6",
75
- "better-auth": "^1.6.6"
74
+ "@better-auth/core": "^1.6.7",
75
+ "better-auth": "^1.6.7"
76
76
  },
77
77
  "scripts": {
78
78
  "build": "tsdown",