fix purging of users with secondary uids I guess

This commit is contained in:
rootdarkarchon
2023-05-29 02:03:14 +02:00
parent 9b87e3c625
commit cc304d5f54

View File

@@ -41,6 +41,14 @@ public static class SharedDbFunctions
{ {
_logger.LogInformation("Purging user: {uid}", user.UID); _logger.LogInformation("Purging user: {uid}", user.UID);
var secondaryUsers = await dbContext.Auth.Include(u => u.PrimaryUser)
.Where(u => u.PrimaryUserUID == user.UID).Select(c => c.User).ToListAsync().ConfigureAwait(false);
foreach (var secondaryUser in secondaryUsers)
{
await PurgeUser(_logger, secondaryUser, dbContext, maxGroupsByUser).ConfigureAwait(false);
}
var lodestone = dbContext.LodeStoneAuth.SingleOrDefault(a => a.User.UID == user.UID); var lodestone = dbContext.LodeStoneAuth.SingleOrDefault(a => a.User.UID == user.UID);
var userProfileData = await dbContext.UserProfileData.SingleOrDefaultAsync(u => u.UserUID == user.UID).ConfigureAwait(false); var userProfileData = await dbContext.UserProfileData.SingleOrDefaultAsync(u => u.UserUID == user.UID).ConfigureAwait(false);