Add debug logging to WASM client Authorization header

This commit is contained in:
Timur Gordon
2025-11-11 11:54:09 +01:00
parent 77e32b360c
commit 2ca593510c

View File

@@ -711,8 +711,13 @@ impl WasmSupervisorClient {
// Add Authorization header if secret is present
if let Some(secret) = &self.secret {
headers.set("Authorization", &format!("Bearer {}", secret))
let auth_value = format!("Bearer {}", secret);
web_sys::console::log_1(&format!("🔐 WASM Client: Setting Authorization header: Bearer {}...", &secret[..secret.len().min(8)]).into());
headers.set("Authorization", &auth_value)
.map_err(|e| WasmClientError::JavaScript(format!("{:?}", e)))?;
web_sys::console::log_1(&"✅ WASM Client: Authorization header set successfully".into());
} else {
web_sys::console::log_1(&"⚠️ WASM Client: NO SECRET - Authorization header NOT set".into());
}
// Create request init