Skip to content

Commit 9c14299

Browse files
Kevin Shenghuisteipete
authored andcommitted
fix: preserve operator scopes for shared auth connections
When connecting via shared gateway token (no device identity), the operator scopes were being cleared, causing API operations to fail with 'missing scope' errors. This fix preserves scopes when sharedAuthOk is true, allowing headless/API operator clients to retain their requested scopes. Fixes #27494 (cherry picked from commit c71c894)
1 parent 0ab5f4c commit 9c14299

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/gateway/server/ws-connection/message-handler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ export function attachGatewayWsMessageHandler(params: {
486486
close(1008, truncateCloseReason(authMessage));
487487
};
488488
const clearUnboundScopes = () => {
489-
if (scopes.length > 0 && !controlUiAuthPolicy.allowBypass) {
489+
if (scopes.length > 0 && !controlUiAuthPolicy.allowBypass && !sharedAuthOk) {
490490
scopes = [];
491491
connectParams.scopes = scopes;
492492
}

0 commit comments

Comments
 (0)