From 6d2430a6051e39219c558f0484be4f1b0329b351 Mon Sep 17 00:00:00 2001 From: Guy Lichtman <1395797+glicht@users.noreply.github.com> Date: Sun, 22 Feb 2026 02:15:00 +0200 Subject: [PATCH] fix(auth): current_scopes read to async --- crates/rmcp/src/transport/auth.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/rmcp/src/transport/auth.rs b/crates/rmcp/src/transport/auth.rs index 1ff2ddd7..ae38632c 100644 --- a/crates/rmcp/src/transport/auth.rs +++ b/crates/rmcp/src/transport/auth.rs @@ -999,10 +999,10 @@ impl AuthorizationManager { .await .map_err(|e| AuthError::TokenRefreshFailed(e.to_string()))?; - let granted_scopes: Vec = token_result - .scopes() - .map(|scopes| scopes.iter().map(|s| s.to_string()).collect()) - .unwrap_or_else(|| self.current_scopes.blocking_read().clone()); + let granted_scopes: Vec = match token_result.scopes() { + Some(scopes) => scopes.iter().map(|s| s.to_string()).collect(), + None => self.current_scopes.read().await.clone(), + }; *self.current_scopes.write().await = granted_scopes.clone();