Skip to main content

Type Alias: WsUpgradeAuth

WsUpgradeAuth = (req) => WsUpgradeAuthResult

Defined in: service-core/src/http/MiddlewareChain.ts:115

Optional pre-upgrade auth function for WebSocket routes. Called synchronously before the WebSocket handshake completes. Returning { reject: true } sends an HTTP 401 and skips the upgrade entirely. Returning {} falls through to the post-upgrade message-based LOGIN flow. Returning { user, ... } pre-authenticates the connection so clients that can send an Authorization header skip the LOGIN step.

Parameters

req

HttpRequest

Returns

WsUpgradeAuthResult