private async Task AttachUserToContext(HttpContext context, IUserService userService, string token) { try { var userName = _jwtManager.ValidateAndGetUserName(token); context.Items["User"] = await userService.GetUser(userName); } catch { // _logger.LogInformation("Failed login attempt"); } }