feat: Enhance network membership and withdrawal processing with user tracking and logging

This commit is contained in:
masoodafar-web
2025-12-01 20:52:18 +03:30
parent 4aaf2247ff
commit 25fc73ae28
47 changed files with 9545 additions and 284 deletions
@@ -14,4 +14,19 @@ public class CurrentUserService : ICurrentUserService
}
public string? UserId => _httpContextAccessor.HttpContext?.User?.FindFirstValue(ClaimTypes.NameIdentifier);
public string? Username => _httpContextAccessor.HttpContext?.User?.FindFirstValue(ClaimTypes.Name)
?? _httpContextAccessor.HttpContext?.User?.FindFirstValue(ClaimTypes.Email);
public bool IsAuthenticated => _httpContextAccessor.HttpContext?.User?.Identity?.IsAuthenticated ?? false;
public string GetPerformedBy()
{
if (!IsAuthenticated || string.IsNullOrEmpty(UserId))
return "System";
return string.IsNullOrEmpty(Username)
? $"User:{UserId}"
: $"{UserId}:{Username}";
}
}