From 678bcf9a80ef1fcf7928df6e94030028b4d6c1af Mon Sep 17 00:00:00 2001 From: Cody Robibero Date: Sat, 7 Jan 2023 11:31:10 -0700 Subject: Use EventManager for AuthenticationSuccess, AuthenticationFailure (#8960) --- Emby.Server.Implementations/Session/SessionManager.cs | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'Emby.Server.Implementations/Session/SessionManager.cs') diff --git a/Emby.Server.Implementations/Session/SessionManager.cs b/Emby.Server.Implementations/Session/SessionManager.cs index 2f60d01a9..afa3721b8 100644 --- a/Emby.Server.Implementations/Session/SessionManager.cs +++ b/Emby.Server.Implementations/Session/SessionManager.cs @@ -95,12 +95,6 @@ namespace Emby.Server.Implementations.Session _deviceManager.DeviceOptionsUpdated += OnDeviceManagerDeviceOptionsUpdated; } - /// - public event EventHandler> AuthenticationFailed; - - /// - public event EventHandler> AuthenticationSucceeded; - /// /// Occurs when playback has started. /// @@ -1468,7 +1462,7 @@ namespace Emby.Server.Implementations.Session if (user is null) { - AuthenticationFailed?.Invoke(this, new GenericEventArgs(request)); + await _eventManager.PublishAsync(new GenericEventArgs(request)).ConfigureAwait(false); throw new AuthenticationException("Invalid username or password entered."); } @@ -1504,8 +1498,7 @@ namespace Emby.Server.Implementations.Session ServerId = _appHost.SystemId }; - AuthenticationSucceeded?.Invoke(this, new GenericEventArgs(returnResult)); - + await _eventManager.PublishAsync(new GenericEventArgs(returnResult)).ConfigureAwait(false); return returnResult; } -- cgit v1.2.3