diff --git a/crates/router/src/services/authorization.rs b/crates/router/src/services/authorization.rs index 5bf66c31f13a..35a0b159ab2e 100644 --- a/crates/router/src/services/authorization.rs +++ b/crates/router/src/services/authorization.rs @@ -115,7 +115,10 @@ pub fn check_permission( pub fn check_tenant(token_tenant_id: Option, header_tenant_id: &str) -> RouterResult<()> { if let Some(tenant_id) = token_tenant_id { if tenant_id != header_tenant_id { - return Err(ApiErrorResponse::InvalidTenant { tenant_id }.into()); + return Err(ApiErrorResponse::InvalidJwtToken).attach_printable(format!( + "Token tenant ID: '{}' does not match Header tenant ID: '{}'", + tenant_id, header_tenant_id + )); } } Ok(())