mirror of
https://github.com/moltbot/moltbot.git
synced 2026-03-21 16:41:56 +00:00
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
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user