Merge remote-tracking branch 'origin/v10/dev' into v11/dev

This commit is contained in:
Bjarke Berg
2023-06-08 08:36:15 +02:00

View File

@@ -96,6 +96,9 @@ internal class ExternalLoginRepository : EntityRepositoryBase<int, IIdentityUser
// do the deletes, updates and inserts
if (toDelete.Count > 0)
{
// Before we can remove the external login, we must remove the external login tokens associated with that external login,
// otherwise we'll get foreign key constraint errors
Database.DeleteMany<ExternalLoginTokenDto>().Where(x => toDelete.Contains(x.ExternalLoginId)).Execute();
Database.DeleteMany<ExternalLoginDto>().Where(x => toDelete.Contains(x.Id)).Execute();
}