Skip to content

Commit fa38c8c

Browse files
committed
Changed to use new generic authentication service signature
1 parent 83c1ce4 commit fa38c8c

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

‎Binner/Binner.Web/Authorization/KiCadTokenAuthorizationHandler.cs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ public class KiCadTokenAuthorizationHandler : AuthorizationHandler<KiCadTokenAut
2020
private readonly ILogger<KiCadTokenAuthorizationHandler> _logger;
2121
private readonly IDbContextFactory<BinnerContext> _contextFactory;
2222
private readonly IRequestContextAccessor _requestContext;
23-
private readonly IAuthenticationService _authenticationService;
23+
private readonly IAuthenticationService<BinnerContext> _authenticationService;
2424

25-
public KiCadTokenAuthorizationHandler(ILogger<KiCadTokenAuthorizationHandler> logger, IDbContextFactory<BinnerContext> contextFactory, IRequestContextAccessor requestContext, IAuthenticationService authenticationService)
25+
public KiCadTokenAuthorizationHandler(ILogger<KiCadTokenAuthorizationHandler> logger, IDbContextFactory<BinnerContext> contextFactory, IRequestContextAccessor requestContext, IAuthenticationService<BinnerContext> authenticationService)
2626
{
2727
_logger = logger;
2828
_contextFactory = contextFactory;

‎Binner/Binner.Web/Configuration/StartupConfiguration.IoC.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ private static void RegisterServices(IServiceCollection services)
136136
services.AddTransient<IStoredFileService, StoredFileService>();
137137
services.AddTransient<IUserService<User>, UserService<User>>();
138138
services.AddTransient<IOrganizationService<Organization>, OrganizationService<Organization>>();
139-
services.AddTransient<IAuthenticationService, AuthenticationService>();
139+
services.AddTransient<IAuthenticationService<BinnerContext>, AuthenticationService<BinnerContext>>();
140140
services.AddTransient<IAccountService<Account>, AccountService<Account>>();
141141
services.AddTransient<IAdminService, AdminService>();
142142
services.AddTransient<IPrintService, PrintService>();

‎Binner/Binner.Web/Controllers/AuthenticationController.cs‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
using Binner.Services;
1+
using Binner.Data;
22
using Binner.Global.Common;
3+
using Binner.LicensedProvider;
34
using Binner.Model.Configuration;
45
using Binner.Model.Requests;
56
using Binner.Model.Responses;
7+
using Binner.Services;
68
using Microsoft.AspNetCore.Authentication.JwtBearer;
79
using Microsoft.AspNetCore.Authorization;
810
using Microsoft.AspNetCore.Http;
@@ -12,7 +14,6 @@
1214
using System.Linq;
1315
using System.Net.Mime;
1416
using System.Threading.Tasks;
15-
using Binner.LicensedProvider;
1617

1718
namespace Binner.Web.Controllers
1819
{
@@ -23,11 +24,11 @@ namespace Binner.Web.Controllers
2324
public partial class AuthenticationController : ControllerBase
2425
{
2526
private readonly ILogger<AuthenticationController> _logger;
26-
private readonly IAuthenticationService _authenticationService;
27+
private readonly IAuthenticationService<BinnerContext> _authenticationService;
2728
private readonly AuthenticationConfiguration _configuration;
2829
private readonly IRequestContextAccessor _requestContextAccessor;
2930

30-
public AuthenticationController(ILogger<AuthenticationController> logger, IAuthenticationService authenticationService, AuthenticationConfiguration configuration, IRequestContextAccessor requestContextAccessor)
31+
public AuthenticationController(ILogger<AuthenticationController> logger, IAuthenticationService<BinnerContext> authenticationService, AuthenticationConfiguration configuration, IRequestContextAccessor requestContextAccessor)
3132
{
3233
_logger = logger;
3334
_authenticationService = authenticationService;

0 commit comments

Comments
 (0)