From 5f69b259507d389ee8e3ca7612c5d1c3d8c826a4 Mon Sep 17 00:00:00 2001 From: Timothy Schenk Date: Mon, 2 Jan 2023 12:25:58 +0100 Subject: [PATCH] pass AesProvider to session --- Server/AuthorizationServer.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Server/AuthorizationServer.cs b/Server/AuthorizationServer.cs index 49d0ebd..eccb0ff 100644 --- a/Server/AuthorizationServer.cs +++ b/Server/AuthorizationServer.cs @@ -7,18 +7,21 @@ using Microsoft.Extensions.Configuration; public class AuthorizationServer : NetCoreServer.TcpServer { - [Inject] private readonly ILogger _logger; + private readonly AesProvider _aesProvider; + private readonly ILogger _logger; - public AuthorizationServer(IConfiguration configuration, ILoggerFactory loggerFactory) : base( + public AuthorizationServer(IConfiguration configuration, ILoggerFactory loggerFactory, AesProvider aesProvider) : base( configuration["auth:address"]!, configuration.GetValue("auth:port")) { + _aesProvider = aesProvider; _logger = loggerFactory.CreateLogger(nameof(AuthorizationServer)); } protected override NetCoreServer.TcpSession CreateSession() { - return null; + var session = new AuthorizationServerSession(this, _logger, _aesProvider); + return session; } protected override void OnStarting()