fix(mcp): narrow OAuth scope to allowed intersection instead of rejecting

When a client requests scopes it is not permitted for, silently drop
them rather than failing the entire authorization flow. The token is
issued with only the intersection of requested and allowed scopes.

Also fix /authorize/validate to always return HTTP 200 so the consent
page can surface the actual error_description instead of a generic
axios failure message.
This commit is contained in:
jubnl
2026-04-09 23:47:53 +02:00
parent 54f280c366
commit 5b44fe68b1
3 changed files with 50 additions and 24 deletions
-4
View File
@@ -167,10 +167,6 @@ oauthApiRouter.get('/authorize/validate', (req: Request, res: Response) => {
userId,
);
if (!result.valid) {
return res.status(400).json(result);
}
return res.json(result);
});