diff --git a/PARR.API/Services/Implementations/AuthService.cs b/PARR.API/Services/Implementations/AuthService.cs index 3e8c4a7b..462b0e8a 100644 --- a/PARR.API/Services/Implementations/AuthService.cs +++ b/PARR.API/Services/Implementations/AuthService.cs @@ -66,11 +66,19 @@ namespace PARR.API.Services.Implementations var cacheData = new UserCache { UserIp = ipAddress, - Roles = roles, - Name = user!.Name, - Description = user.Description ?? string.Empty + Roles = roles }; + if (host != null) + cacheData.Name = host.Ek; + + if (user != null) + { + cacheData.Name = user.Name + host != null ? $", {host!.Ek}" : string.Empty; + cacheData.Description = user.Description ?? string.Empty; + } + + await cacheService.SetCachedDataAsync(GetAllowKey(ipAddress), cacheData, userCacheSettings.UserCacheTtl); return cacheData;