mirror of
https://github.com/Caraxi/mare.server.git
synced 2025-12-12 15:47:23 +01:00
add secondary UID stuff
This commit is contained in:
parent
96e89437c0
commit
677224e363
10 changed files with 1196 additions and 177 deletions
|
|
@ -119,7 +119,15 @@ internal class DiscordBot : IHostedService
|
|||
if (discordUser == null || !discordUser.RoleIds.Any(u => allowedRoleIds.Contains(u)))
|
||||
{
|
||||
_logger.LogInformation($"User {lodestoneAuth.User.UID} not in allowed roles, deleting alias");
|
||||
lodestoneAuth.User.Alias = string.Empty;
|
||||
lodestoneAuth.User.Alias = null;
|
||||
var secondaryUsers = await db.Auth.Include(u => u.User).Where(u => u.PrimaryUserUID == lodestoneAuth.User.UID).ToListAsync().ConfigureAwait(false);
|
||||
foreach (var secondaryUser in secondaryUsers)
|
||||
{
|
||||
_logger.LogInformation($"Secondary User {secondaryUser.User.UID} not in allowed roles, deleting alias");
|
||||
|
||||
secondaryUser.User.Alias = null;
|
||||
db.Update(secondaryUser.User);
|
||||
}
|
||||
db.Update(lodestoneAuth.User);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue