From 74d91a0315576409fad907848d7c68b9ac83b61f Mon Sep 17 00:00:00 2001 From: Mikhail Trubnikov Date: Tue, 5 Dec 2023 11:25:07 +1000 Subject: [PATCH] =?UTF-8?q?fix(api):=20=D0=B7=D0=B0=D0=BF=D0=BE=D0=BB?= =?UTF-8?q?=D0=BD=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=B4=D0=B0=D0=BD=D0=BD=D1=8B?= =?UTF-8?q?=D1=85=20=D0=BE=20=D0=BF=D0=BE=D0=BB=D1=8C=D0=B7=D0=BE=D0=B2?= =?UTF-8?q?=D0=B0=D1=82=D0=B5=D0=BB=D0=B5=20=D0=B2=20=D0=BA=D1=8D=D1=88?= =?UTF-8?q?=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PARR.API/Services/Implementations/AuthService.cs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) 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;