Skip to content

Commit 1aba653

Browse files
committed
Fixes oauthCheck
Signed-off-by: Marcos Candeia <[email protected]>
1 parent 7b4d694 commit 1aba653

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

apps/api/src/oauth.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ const sanitize = (path: string) => {
7474
};
7575

7676
const isListToolsRequest = async (c: Context<AppEnv>) => {
77-
const clonedReq = c.req.raw.clone();
7877
try {
78+
const clonedReq = c.req.raw.clone();
7979
const body = (await clonedReq.json()) as { method?: string };
8080
// Allow tools/list to pass without auth
8181
return body?.method === "tools/list";
@@ -358,7 +358,7 @@ export const withOAuth = ({
358358
const url = new URL(c.req.url);
359359
const ctx = honoCtxToAppCtx(c);
360360

361-
if (!ctx.user && !isListToolsRequest(c)) {
361+
if (!ctx.user && !(await isListToolsRequest(c))) {
362362
// Get OAuth params using the provided function
363363
const params = await getOAuthParams(c);
364364
// Build resource metadata URL using the MCP URL builder (no query params)

0 commit comments

Comments
 (0)