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
|
||||
"command": "npx",
|
||||
"args": [
|
||||
"-y"
|
||||
"-y",
|
||||
"mcp-remote",
|
||||
"https://remote.mcp.server/sse"
|
||||
]
|
||||
|
|
|
@ -300,7 +300,13 @@ export function setupOAuthCallbackServerWithLongPoll(options: OAuthCallbackServe
|
|||
log('Auth code received, resolving promise')
|
||||
authCompletedResolve(code)
|
||||
|
||||
res.send('Authorization successful! You may close this window and return to the CLI.')
|
||||
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.')
|
||||
}
|
||||
|
||||
// Notify main flow that auth code is available
|
||||
options.events.emit('auth-code-received', code)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue