diff --git a/backend/crates/infrastructure/src/registry.rs b/backend/crates/infrastructure/src/registry.rs index daa2744..4b8df39 100644 --- a/backend/crates/infrastructure/src/registry.rs +++ b/backend/crates/infrastructure/src/registry.rs @@ -152,14 +152,7 @@ impl ImageRegistry for CurlImageRegistry { DomainError::Unavailable(format!("{host}: authentication required")) })?; let (_, _, token_body) = self.get(&challenge, None).await?; - #[derive(serde::Deserialize)] - struct Token { - #[serde(alias = "access_token")] - token: Option, - } - token = serde_json::from_str::(&token_body) - .ok() - .and_then(|t| t.token); + token = parse_token(&token_body); if token.is_none() { return Err(DomainError::Unavailable(format!( "{host}: no token in the auth response"