Support custom post-auth redirect uri
This commit is contained in:
parent
da1330d2aa
commit
c205612e17
2 changed files with 8 additions and 2 deletions
|
@ -79,7 +79,7 @@ To bypass authentication, or to emit custom headers on all requests to your remo
|
||||||
```json
|
```json
|
||||||
"command": "npx",
|
"command": "npx",
|
||||||
"args": [
|
"args": [
|
||||||
"-y"
|
"-y",
|
||||||
"mcp-remote",
|
"mcp-remote",
|
||||||
"https://remote.mcp.server/sse"
|
"https://remote.mcp.server/sse"
|
||||||
]
|
]
|
||||||
|
|
|
@ -300,7 +300,13 @@ export function setupOAuthCallbackServerWithLongPoll(options: OAuthCallbackServe
|
||||||
log('Auth code received, resolving promise')
|
log('Auth code received, resolving promise')
|
||||||
authCompletedResolve(code)
|
authCompletedResolve(code)
|
||||||
|
|
||||||
|
const postAuthRedirectUri = req.query.postAuthRedirectUri as string | undefined
|
||||||
|
if (postAuthRedirectUri) {
|
||||||
|
log(`Redirecting to post-auth redirect URI: ${postAuthRedirectUri}`)
|
||||||
|
res.redirect(postAuthRedirectUri);
|
||||||
|
} else {
|
||||||
res.send('Authorization successful! You may close this window and return to the CLI.')
|
res.send('Authorization successful! You may close this window and return to the CLI.')
|
||||||
|
}
|
||||||
|
|
||||||
// Notify main flow that auth code is available
|
// Notify main flow that auth code is available
|
||||||
options.events.emit('auth-code-received', code)
|
options.events.emit('auth-code-received', code)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue