From 6231fc18eac67966340fddc121dc2895fd99ab5e Mon Sep 17 00:00:00 2001 From: Cromefire_ <26320625+cromefire@users.noreply.github.com> Date: Fri, 13 Dec 2019 15:27:12 +0100 Subject: [PATCH 1/2] Fixed invalid username handling --- .../Session/SessionManager.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Emby.Server.Implementations/Session/SessionManager.cs b/Emby.Server.Implementations/Session/SessionManager.cs index b87ca3a114..80079ae6c0 100644 --- a/Emby.Server.Implementations/Session/SessionManager.cs +++ b/Emby.Server.Implementations/Session/SessionManager.cs @@ -1393,6 +1393,13 @@ namespace Emby.Server.Implementations.Session } } + if (user == null) + { + AuthenticationFailed?.Invoke(this, new GenericEventArgs(request)); + + throw new SecurityException("Invalid user or password entered."); + } + if (enforcePassword) { user = await _userManager.AuthenticateUser( @@ -1403,13 +1410,6 @@ namespace Emby.Server.Implementations.Session true).ConfigureAwait(false); } - if (user == null) - { - AuthenticationFailed?.Invoke(this, new GenericEventArgs(request)); - - throw new SecurityException("Invalid user or password entered."); - } - var token = GetAuthorizationToken(user, request.DeviceId, request.App, request.AppVersion, request.DeviceName); var session = LogSessionActivity( From 7e987b9642fd1826b9adb8dc6e208454c44da4dc Mon Sep 17 00:00:00 2001 From: Cromefire_ <26320625+cromefire@users.noreply.github.com> Date: Fri, 13 Dec 2019 15:30:08 +0100 Subject: [PATCH 2/2] Remove whitespace Co-Authored-By: Claus Vium --- Emby.Server.Implementations/Session/SessionManager.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/Emby.Server.Implementations/Session/SessionManager.cs b/Emby.Server.Implementations/Session/SessionManager.cs index 80079ae6c0..367e1d4983 100644 --- a/Emby.Server.Implementations/Session/SessionManager.cs +++ b/Emby.Server.Implementations/Session/SessionManager.cs @@ -1396,7 +1396,6 @@ namespace Emby.Server.Implementations.Session if (user == null) { AuthenticationFailed?.Invoke(this, new GenericEventArgs(request)); - throw new SecurityException("Invalid user or password entered."); }