diff --git a/DAL/DIExtensions.cs b/DAL/DIExtensions.cs index 94ec8e4..6488c8f 100644 --- a/DAL/DIExtensions.cs +++ b/DAL/DIExtensions.cs @@ -40,6 +40,7 @@ namespace DAL services.AddScoped(); services.AddScoped(); services.AddScoped(); + services.AddScoped(); return services; } diff --git a/StaffDBServer/Program.cs b/StaffDBServer/Program.cs index f691fe3..2694ceb 100644 --- a/StaffDBServer/Program.cs +++ b/StaffDBServer/Program.cs @@ -16,6 +16,7 @@ using System.Reflection; using HRD.LDAPService.JWT; using HRD.WebApi.DAL.Middleware; using HRD.WebApi.Helpers; +using StaffDBServer.SharedControllers; AppDomain.CurrentDomain.UnhandledException += (object sender, UnhandledExceptionEventArgs unhandledExceptionEventArgs) => { @@ -54,6 +55,8 @@ try }); builder.Services.AddStaffDBRepositories(); + builder.Services.AddScoped(); + builder.Services.ConfigureWebApiExtensionsEnd(); // should come last var app = builder.Build(); diff --git a/StaffDBServer/_Shared/SharedControllers/WebAppUserController.cs b/StaffDBServer/_Shared/SharedControllers/WebAppUserController.cs index e7fa4c5..b150b1a 100644 --- a/StaffDBServer/_Shared/SharedControllers/WebAppUserController.cs +++ b/StaffDBServer/_Shared/SharedControllers/WebAppUserController.cs @@ -11,11 +11,11 @@ using System.Threading.Tasks; namespace StaffDBServer.SharedControllers { - [JWTAuthorizeAttribute] + [JWTAuthorize] public class WebAppUserController : BaseMiniController { private readonly WebAppUserRepository webAppUserRepository; - WebAppUserHelper webAppUserHelper; + private readonly WebAppUserHelper webAppUserHelper; public WebAppUserController(WebApiContext context, WebAppUserRepository webAppUserRepository, WebAppUserHelper webAppUserHelper) : base(context) {