@better-auth/oauth-provider 1.4.12 → 1.4.13

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,4 +1,4 @@
1
- import { a as getJwtPlugin, f as handleMcpErrors, o as getOAuthProviderPlugin } from "./utils-BXDziLB6.mjs";
1
+ import { a as getJwtPlugin, f as handleMcpErrors, o as getOAuthProviderPlugin } from "./utils-LksXOM6z.mjs";
2
2
  import { verifyAccessToken } from "better-auth/oauth2";
3
3
  import { APIError } from "better-call";
4
4
  import { BetterAuthError } from "@better-auth/core/error";
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { a as getJwtPlugin, c as parsePrompt, d as validateClientCredentials, i as getClient, l as storeClientSecret, n as decryptStoredClientSecret, p as mcpHandler, r as deleteFromPrompt, s as getStoredToken, t as basicToClientCredentials, u as storeToken } from "./utils-BXDziLB6.mjs";
1
+ import { a as getJwtPlugin, c as parsePrompt, d as validateClientCredentials, i as getClient, l as storeClientSecret, n as decryptStoredClientSecret, p as mcpHandler, r as deleteFromPrompt, s as getStoredToken, t as basicToClientCredentials, u as storeToken } from "./utils-LksXOM6z.mjs";
2
2
  import { generateCodeChallenge, getJwks, verifyJwsAccessToken } from "better-auth/oauth2";
3
3
  import { APIError } from "better-call";
4
4
  import { BetterAuthError } from "@better-auth/core/error";
@@ -643,7 +643,7 @@ async function createRefreshToken(ctx, opts, user, referenceId, client, scopes,
643
643
  * and returns a valid audience based on the request
644
644
  */
645
645
  async function checkResource(ctx, opts, scopes) {
646
- let resource = ctx.body.resource;
646
+ const resource = ctx.body.resource;
647
647
  const audience = typeof resource === "string" ? [resource] : resource ? [...resource] : void 0;
648
648
  if (audience) {
649
649
  if (scopes.includes("openid")) audience.push(`${ctx.context.baseURL}/oauth2/userinfo`);
@@ -1007,7 +1007,7 @@ async function validateJwtAccessToken(ctx, opts, token, clientId) {
1007
1007
  if (!client || client?.disabled) return { active: false };
1008
1008
  if (clientId && jwtPayload.azp !== clientId) return { active: false };
1009
1009
  }
1010
- let sessionId = jwtPayload.sid;
1010
+ const sessionId = jwtPayload.sid;
1011
1011
  if (sessionId) {
1012
1012
  const session = await ctx.context.adapter.findOne({
1013
1013
  model: "session",
@@ -1385,7 +1385,7 @@ async function createOAuthClientEndpoint(ctx, opts, settings) {
1385
1385
  user: session?.user,
1386
1386
  session: session?.session
1387
1387
  }) : void 0;
1388
- let schema$1 = oauthToSchema({
1388
+ const schema$1 = oauthToSchema({
1389
1389
  ...body ?? {},
1390
1390
  disabled: void 0,
1391
1391
  jwks: void 0,
@@ -273,7 +273,7 @@ function parsePrompt(prompt) {
273
273
  * @param prompt - the prompt value to delete
274
274
  */
275
275
  function deleteFromPrompt(query, prompt) {
276
- let prompts = query.get("prompt")?.split(" ");
276
+ const prompts = query.get("prompt")?.split(" ");
277
277
  const foundPrompt = prompts?.findIndex((v) => v === prompt) ?? -1;
278
278
  if (foundPrompt >= 0) {
279
279
  prompts?.splice(foundPrompt, 1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@better-auth/oauth-provider",
3
- "version": "1.4.12",
3
+ "version": "1.4.13",
4
4
  "type": "module",
5
5
  "description": "An oauth provider plugin for Better Auth",
6
6
  "main": "dist/index.mjs",
@@ -42,8 +42,8 @@
42
42
  "@modelcontextprotocol/sdk": "^1.25.2",
43
43
  "listhen": "^1.9.0",
44
44
  "tsdown": "^0.17.2",
45
- "@better-auth/core": "1.4.12",
46
- "better-auth": "1.4.12"
45
+ "@better-auth/core": "1.4.13",
46
+ "better-auth": "1.4.13"
47
47
  },
48
48
  "dependencies": {
49
49
  "jose": "^6.1.0",
@@ -53,8 +53,8 @@
53
53
  "@better-auth/utils": "0.3.0",
54
54
  "@better-fetch/fetch": "1.1.21",
55
55
  "better-call": "1.1.7",
56
- "@better-auth/core": "1.4.12",
57
- "better-auth": "1.4.12"
56
+ "@better-auth/core": "1.4.13",
57
+ "better-auth": "1.4.13"
58
58
  },
59
59
  "files": [
60
60
  "dist"