adjust DTOs, add call to push character data to visible clients

This commit is contained in:
Stanley Dimant 2022-06-30 17:19:58 +02:00
parent 3e00bc4efd
commit d56923d553
13 changed files with 82 additions and 72 deletions

View file

@ -45,9 +45,16 @@ namespace MareSynchronosServer.Authentication
return AuthenticateResult.Fail("Failed Authorization");
}
user.CharacterIdentification = charNameHeader;
_mareDbContext.Users.Update(user);
await _mareDbContext.SaveChangesAsync();
if (user.CharacterIdentification != charNameHeader)
{
try
{
user.CharacterIdentification = charNameHeader;
_mareDbContext.Users.Update(user);
await _mareDbContext.SaveChangesAsync();
}
catch (DbUpdateConcurrencyException) { }
}
var claims = new List<Claim> {
new Claim(ClaimTypes.Name, user.CharacterIdentification),