Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<PackageVersion Include="Microsoft.OpenApi" Version="2.12.2" />
<PackageVersion Include="Scalar.AspNetCore" Version="2.17.13" />
<PackageVersion Include="PdfPig" Version="0.1.16" />
<PackageVersion Include="MailKit" Version="4.18.1" />
<PackageVersion Include="MailKit" Version="4.18.2" />
<PackageVersion Include="AWSSDK.Core" Version="4.0.102.8" />
<PackageVersion Include="AWSSDK.S3" Version="4.0.104.1" />
<PackageVersion Include="Azure.Storage.Blobs" Version="12.30.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<EventId>(),
It.Is<It.IsAnyType>((v, _) => v.ToString()!.Contains("keeps old@shop.com") && v.ToString()!.Contains("customer c2")),
It.Is<It.IsAnyType>((v, _) => v.ToString()!.Contains("customer c2") && !v.ToString()!.Contains("@shop.com")),
It.IsAny<Exception>(), It.IsAny<Func<It.IsAnyType, Exception, string>>()), Times.Once);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,25 +50,25 @@ 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;
}

//nor may an account take an address listed there: the password it still has would open the Admin login page
//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;
}

Expand Down
Loading