Return 404 JSON for oauth-protected-resource discovery probes.
Stop 302ing Claude well-known checks to /login without advertising OAuth. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -16,7 +16,9 @@ export default defineEventHandler((event) => {
|
||||
path === '/login' ||
|
||||
// Claude MCP discovery — never 302 to /login (JSON 404 handlers serve these).
|
||||
path === '/.well-known/oauth-authorization-server' ||
|
||||
path === '/.well-known/openid-configuration'
|
||||
path === '/.well-known/openid-configuration' ||
|
||||
path === '/.well-known/oauth-protected-resource' ||
|
||||
path.startsWith('/.well-known/oauth-protected-resource/')
|
||||
) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
/** Claude discovery probe — no OAuth; never redirect to /login. */
|
||||
export default defineEventHandler((event) => {
|
||||
setResponseStatus(event, 404)
|
||||
setResponseHeader(event, 'Content-Type', 'application/json')
|
||||
setResponseHeader(event, 'Cache-Control', 'no-store')
|
||||
return { error: 'not found' }
|
||||
})
|
||||
@@ -0,0 +1,7 @@
|
||||
/** Claude discovery probe — no OAuth; never redirect to /login. */
|
||||
export default defineEventHandler((event) => {
|
||||
setResponseStatus(event, 404)
|
||||
setResponseHeader(event, 'Content-Type', 'application/json')
|
||||
setResponseHeader(event, 'Cache-Control', 'no-store')
|
||||
return { error: 'not found' }
|
||||
})
|
||||
Reference in New Issue
Block a user