diff --git a/VirtoCommerce.Storefront/Infrastructure/Autorest/BaseAuthHandler.cs b/VirtoCommerce.Storefront/Infrastructure/Autorest/BaseAuthHandler.cs index ec91dcaf..be44edee 100644 --- a/VirtoCommerce.Storefront/Infrastructure/Autorest/BaseAuthHandler.cs +++ b/VirtoCommerce.Storefront/Infrastructure/Autorest/BaseAuthHandler.cs @@ -64,8 +64,12 @@ protected void AddCurrentUser(HttpRequestMessage request) } else { - request.Headers.Add("VirtoCommerce-User-Name", "Anonymous"); - request.Headers.Add("VirtoCommerce-Anonymous-User-Id", currentUser?.Id); + // Skip Passing of VirtoCommerce-User-Name if Token Authorization is usdde + if (!request.Headers.Contains("Authorization")) + { + request.Headers.Add("VirtoCommerce-User-Name", "Anonymous"); + request.Headers.Add("VirtoCommerce-Anonymous-User-Id", currentUser?.Id); + } } } }