From 357d0eb871930e0d12b204d31dde5a2ab1cf24c4 Mon Sep 17 00:00:00 2001 From: Oleg Zhuk Date: Wed, 3 Apr 2024 13:51:44 +0200 Subject: [PATCH] VCST-905: Problem with login under personal account (#679) fix: Problem with login under personal account --- .../Infrastructure/Autorest/BaseAuthHandler.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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); + } } } }