diff --git a/src/auth/models/user-secret.ts b/src/auth/models/user-secret.ts index f5809ea..16035cd 100644 --- a/src/auth/models/user-secret.ts +++ b/src/auth/models/user-secret.ts @@ -55,6 +55,7 @@ export class UserSecret { static async verifyToken(token: string) { if (token?.includes?.('.')) { // 先尝试作为jwt token验证,如果验证成功则直接返回用户信息 + console.log('[jwksManager] 验证token'); return await jwksManager.verify(token); } if (!oauth.isSecretKey(token)) { diff --git a/src/modules/v1-ws-proxy/index.ts b/src/modules/v1-ws-proxy/index.ts index f545aee..055330d 100644 --- a/src/modules/v1-ws-proxy/index.ts +++ b/src/modules/v1-ws-proxy/index.ts @@ -6,7 +6,6 @@ import { WebSocketListenerFun } from '@kevisual/router/src/server/server-type.ts export const wssFun: WebSocketListenerFun = async (req, res) => { // do nothing, just to enable ws upgrade event const { id, ws, token, data, emitter } = req; - logger.debug('ws proxy connected, id=', id, ' token=', token, ' data=', data); // console.log('req', req) const { type } = data || {}; if (type === 'registryClient') { @@ -27,6 +26,7 @@ export const wssFun: WebSocketListenerFun = async (req, res) => { logger.debug('ws 连接已存在,关闭旧连接', userApp); wsMessage.ws.close(); wsProxyManager.unregister(userApp); + await new Promise((resolve) => setTimeout(resolve, 200)); } // @ts-ignore wsProxyManager.register(userApp, { user, ws });