1
0
mirror of https://github.com/RaidMax/IW4M-Admin.git synced 2025-06-08 06:08:20 -05:00

bugfix for edge case of linking alias to new account

This commit is contained in:
RaidMax 2021-08-31 09:53:01 -05:00
parent 90d406a78a
commit c0d76612ed

View File

@ -339,6 +339,14 @@ namespace SharedLibraryCore.Services
if (existingExactAlias != null)
{
if (existingExactAlias.LinkId != entity.AliasLinkId)
{
_logger.LogInformation("[{Method}] client {Client} is linked to link id {OldLinkId}, but since name and IP match exactly, updating to new link id {NewLinkId}",
nameof(UpdateAliasNew), entity.ToString(), existingExactAlias.LinkId, entity.AliasLinkId);
existingExactAlias.LinkId = entity.AliasLinkId;
await context.SaveChangesAsync();
}
entity.CurrentAlias = existingExactAlias;
entity.CurrentAliasId = existingExactAlias.AliasId;
_logger.LogDebug("[{Method}] client {Client} already has an existing exact alias, so we are not making changes", nameof(UpdateAliasNew), entity.ToString());