mirror of
https://github.com/siteboon/claudecodeui.git
synced 2026-06-05 12:25:35 +08:00
Compare commits
1 Commits
fix/chat-t
...
fix/redact
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3de9c31922 |
@@ -20,7 +20,13 @@ export function verifyWebSocketClient(
|
|||||||
dependencies: WebSocketAuthDependencies
|
dependencies: WebSocketAuthDependencies
|
||||||
): boolean {
|
): boolean {
|
||||||
const request = info.req as AuthenticatedWebSocketRequest;
|
const request = info.req as AuthenticatedWebSocketRequest;
|
||||||
console.log('WebSocket connection attempt to:', request.url);
|
const upgradeUrl = new URL(request.url ?? '/', 'http://localhost');
|
||||||
|
const loggedUrl = new URL(upgradeUrl);
|
||||||
|
if (loggedUrl.searchParams.has('token')) {
|
||||||
|
loggedUrl.searchParams.set('token', 'REDACTED');
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log('WebSocket connection attempt to:', `${loggedUrl.pathname}${loggedUrl.search}`);
|
||||||
|
|
||||||
// Platform mode: use the first DB user and skip token checks.
|
// Platform mode: use the first DB user and skip token checks.
|
||||||
if (dependencies.isPlatform) {
|
if (dependencies.isPlatform) {
|
||||||
@@ -36,7 +42,6 @@ export function verifyWebSocketClient(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// OSS mode: read JWT from query string first, then Authorization header.
|
// OSS mode: read JWT from query string first, then Authorization header.
|
||||||
const upgradeUrl = new URL(request.url ?? '/', 'http://localhost');
|
|
||||||
const token =
|
const token =
|
||||||
upgradeUrl.searchParams.get('token') ??
|
upgradeUrl.searchParams.get('token') ??
|
||||||
request.headers.authorization?.split(' ')[1] ??
|
request.headers.authorization?.split(' ')[1] ??
|
||||||
|
|||||||
Reference in New Issue
Block a user