diff --git a/src/gateway/server/ws-connection/message-handler.ts b/src/gateway/server/ws-connection/message-handler.ts index 261e9f69da2..17db4aba345 100644 --- a/src/gateway/server/ws-connection/message-handler.ts +++ b/src/gateway/server/ws-connection/message-handler.ts @@ -481,7 +481,7 @@ export function attachGatewayWsMessageHandler(params: { close(1008, truncateCloseReason(authMessage)); }; const clearUnboundScopes = () => { - if (scopes.length > 0 && !controlUiAuthPolicy.allowBypass) { + if (scopes.length > 0 && !controlUiAuthPolicy.allowBypass && !sharedAuthOk) { scopes = []; connectParams.scopes = scopes; }