diff --git a/Directory.Packages.props b/Directory.Packages.props index b82a1d2e1..e0c9aceeb 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -13,7 +13,7 @@ - + diff --git a/src/Tests/Grand.Web.Common.Tests/Security/Oidc/OidcProfileSynchronizerTests.cs b/src/Tests/Grand.Web.Common.Tests/Security/Oidc/OidcProfileSynchronizerTests.cs index 8a0e94733..caf87abd4 100644 --- a/src/Tests/Grand.Web.Common.Tests/Security/Oidc/OidcProfileSynchronizerTests.cs +++ b/src/Tests/Grand.Web.Common.Tests/Security/Oidc/OidcProfileSynchronizerTests.cs @@ -134,7 +134,7 @@ public async Task Email_TakenByOther_Kept() VerifyEmail("new@shop.com", Times.Never()); Assert.AreEqual("old@shop.com", _customer.Email); _logger.Verify(x => x.Log(LogLevel.Warning, It.IsAny(), - It.Is((v, _) => v.ToString()!.Contains("keeps old@shop.com") && v.ToString()!.Contains("customer c2")), + It.Is((v, _) => v.ToString()!.Contains("customer c2") && !v.ToString()!.Contains("@shop.com")), It.IsAny(), It.IsAny>()), Times.Once); } diff --git a/src/Web/Grand.Web.Common/Security/Oidc/OidcProfileSynchronizer.cs b/src/Web/Grand.Web.Common/Security/Oidc/OidcProfileSynchronizer.cs index 105caa6d8..551c07071 100644 --- a/src/Web/Grand.Web.Common/Security/Oidc/OidcProfileSynchronizer.cs +++ b/src/Web/Grand.Web.Common/Security/Oidc/OidcProfileSynchronizer.cs @@ -50,8 +50,8 @@ private async Task SyncEmail(Customer customer, ExternalRegistrationIdentity ide //emergency access if (loginConfig.IsBreakGlass(customer.Email)) { - logger.LogWarning("OpenID Connect profile sync: break-glass customer {CustomerId} keeps {OldEmail} " + - "(the identity provider has {NewEmail})", customer.Id, customer.Email, newEmail); + logger.LogWarning("OpenID Connect profile sync: break-glass customer {CustomerId} keeps its e-mail " + + "(the identity provider has a different one)", customer.Id); return; } @@ -59,16 +59,16 @@ private async Task SyncEmail(Customer customer, ExternalRegistrationIdentity ide //and keep it signed in past the provider if (loginConfig.IsBreakGlass(newEmail)) { - logger.LogWarning("OpenID Connect profile sync: customer {CustomerId} keeps {OldEmail}: {NewEmail} is a " + - "break-glass address", customer.Id, customer.Email, newEmail); + logger.LogWarning("OpenID Connect profile sync: customer {CustomerId} keeps its e-mail: the identity " + + "provider's one is a break-glass address", customer.Id); return; } var owner = await customerService.GetCustomerByEmail(newEmail, customerConfig.RegisterCustomersPerStore ? storeId : ""); if (owner != null && owner.Id != customer.Id) { - logger.LogWarning("OpenID Connect profile sync: customer {CustomerId} keeps {OldEmail}: {NewEmail} belongs to customer {OtherId}", - customer.Id, customer.Email, newEmail, owner.Id); + logger.LogWarning("OpenID Connect profile sync: customer {CustomerId} keeps its e-mail: the identity " + + "provider's one belongs to customer {OtherId}", customer.Id, owner.Id); return; }