diff --git a/src/WorkFlowCheck.API/Controllers/CheckListController.cs b/src/WorkFlowCheck.API/Controllers/CheckListController.cs index 7d581bf..0ce3848 100644 --- a/src/WorkFlowCheck.API/Controllers/CheckListController.cs +++ b/src/WorkFlowCheck.API/Controllers/CheckListController.cs @@ -12,30 +12,30 @@ namespace WorkFlowCheck.API.Controllers public class CheckListController : ControllerBase { private ICheckListService _checkListService; - public CheckListController(ICheckListService checkListService) - { - _checkListService = checkListService; - } - - [HttpGet("GetDashboardInfo")] - public async Task> GetDashboardInfo() - { - var retVal = new ApiResponseDTO(); - try - { - retVal.Data = await _checkListService.GetDashboardInfoAsync(); - retVal.IsSuccess = true; - } - catch (Exception ex) - { - retVal.IsSuccess = false; - retVal.Errors.Add("A műszerfal adatainak lekérése sikertelen."); - Log.Error(ex, "GetDashboardInfo failed"); - } - return retVal; - } - - [HttpGet("GetCheckListHeader/{id}")] + public CheckListController(ICheckListService checkListService) + { + _checkListService = checkListService; + } + + [HttpGet("GetDashboardInfo")] + public async Task> GetDashboardInfo() + { + var retVal = new ApiResponseDTO(); + try + { + retVal.Data = await _checkListService.GetDashboardInfoAsync(); + retVal.IsSuccess = true; + } + catch (Exception ex) + { + retVal.IsSuccess = false; + retVal.Errors.Add("A műszerfal adatainak lekérése sikertelen."); + Log.Error(ex, "GetDashboardInfo failed"); + } + return retVal; + } + + [HttpGet("GetCheckListHeader/{id}")] public async Task> GetCheckListHeader(int id) { var retVal = new ApiResponseDTO() diff --git a/src/WorkFlowCheck.Web/Middleware/JwtMiddleware.cs b/src/WorkFlowCheck.Web/Middleware/JwtMiddleware.cs index 27752ac..afd928e 100644 --- a/src/WorkFlowCheck.Web/Middleware/JwtMiddleware.cs +++ b/src/WorkFlowCheck.Web/Middleware/JwtMiddleware.cs @@ -19,6 +19,16 @@ namespace WorkFlowCheck.Web.Middleware public async Task Invoke(HttpContext context) { + var pathignore = context.Request.Path; + if (pathignore.StartsWithSegments("/css") || + pathignore.StartsWithSegments("/js") || + pathignore.StartsWithSegments("/lib") || + pathignore.StartsWithSegments("/images") || + pathignore.StartsWithSegments("/favicon.ico")) + { + await _next(context); + return; + } var token = context.Request.Cookies["AuthToken"]; if (!string.IsNullOrEmpty(token) && ValidateToken(token, out var claims)) diff --git a/src/WorkFlowCheck.Web/Services/CheckListService.cs b/src/WorkFlowCheck.Web/Services/CheckListService.cs index 697bdb0..004aa3d 100644 --- a/src/WorkFlowCheck.Web/Services/CheckListService.cs +++ b/src/WorkFlowCheck.Web/Services/CheckListService.cs @@ -13,27 +13,27 @@ namespace WorkFlowCheck.Web.Services { public class CheckListService : BaseService, ICheckListService { - public CheckListService(HttpClient httpClient, IConfiguration configuration, IHttpContextAccessor httpContextAccessor) : base(httpClient, configuration, httpContextAccessor) - { - } - public async Task GetDashboardInfoAsync() - { - var endpoint = $"{_httpClient.BaseAddress}api/CheckList/GetDashboardInfo"; - try - { - var response = await _httpClient.GetFromJsonAsync>(endpoint); - if (response?.IsSuccess == true && response.Data != null) - { - return response.Data; - } - } - catch (Exception ex) - { - Log.Error(ex, "GetDashboardInfoAsync failed"); - } - return new DashboardDTO { GeneratedAt = DateTime.Now }; - } - public async Task>> GetFilteredCheckListHeaderAsync(DataTablesRequest dataTablesRequest) + public CheckListService(HttpClient httpClient, IConfiguration configuration, IHttpContextAccessor httpContextAccessor) : base(httpClient, configuration, httpContextAccessor) + { + } + public async Task GetDashboardInfoAsync() + { + var endpoint = $"{_httpClient.BaseAddress}api/CheckList/GetDashboardInfo"; + try + { + var response = await _httpClient.GetFromJsonAsync>(endpoint); + if (response?.IsSuccess == true && response.Data != null) + { + return response.Data; + } + } + catch (Exception ex) + { + Log.Error(ex, "GetDashboardInfoAsync failed"); + } + return new DashboardDTO { GeneratedAt = DateTime.Now }; + } + public async Task>> GetFilteredCheckListHeaderAsync(DataTablesRequest dataTablesRequest) { try {