mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-22 08:15:53 +00:00
fix: add Authorization header to peer message requests
getBridgeAccessToken() provides the OAuth Bearer token, matching the auth pattern used by bridgeApi.ts and codeSessionApi.ts. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import { logForDebugging } from '../utils/debug.js'
|
import { logForDebugging } from '../utils/debug.js'
|
||||||
import { errorMessage } from '../utils/errors.js'
|
import { errorMessage } from '../utils/errors.js'
|
||||||
|
import { getBridgeAccessToken } from './bridgeConfig.js'
|
||||||
import { getReplBridgeHandle } from './replBridgeHandle.js'
|
import { getReplBridgeHandle } from './replBridgeHandle.js'
|
||||||
import { toCompatSessionId } from './sessionIdCompat.js'
|
import { toCompatSessionId } from './sessionIdCompat.js'
|
||||||
|
|
||||||
@@ -29,6 +30,11 @@ export async function postInterClaudeMessage(
|
|||||||
return { ok: false, error: 'No target session specified' }
|
return { ok: false, error: 'No target session specified' }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const accessToken = getBridgeAccessToken()
|
||||||
|
if (!accessToken) {
|
||||||
|
return { ok: false, error: 'No access token available' }
|
||||||
|
}
|
||||||
|
|
||||||
const compatTarget = toCompatSessionId(target)
|
const compatTarget = toCompatSessionId(target)
|
||||||
const from = toCompatSessionId(handle.bridgeSessionId)
|
const from = toCompatSessionId(handle.bridgeSessionId)
|
||||||
const baseUrl = handle.sessionIngressUrl
|
const baseUrl = handle.sessionIngressUrl
|
||||||
@@ -44,6 +50,7 @@ export async function postInterClaudeMessage(
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
headers: {
|
headers: {
|
||||||
|
Authorization: `Bearer ${accessToken}`,
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'anthropic-version': '2023-06-01',
|
'anthropic-version': '2023-06-01',
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user