aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBond-009 <bond.009@outlook.com>2019-12-15 10:07:22 +0100
committerGitHub <noreply@github.com>2019-12-15 10:07:22 +0100
commitb8c61a5c40e0541259914c5d4c4456294eb7f9db (patch)
tree6b12c313e1dff174b2a9cf0d39d92ae46bde635b
parentd79242c3c7092ce1d2309937157cc513a2d7d532 (diff)
parent7e987b9642fd1826b9adb8dc6e208454c44da4dc (diff)
Merge pull request #2146 from cromefire/patch-1
Fix invalid username handling
-rw-r--r--Emby.Server.Implementations/Session/SessionManager.cs13
1 files changed, 6 insertions, 7 deletions
diff --git a/Emby.Server.Implementations/Session/SessionManager.cs b/Emby.Server.Implementations/Session/SessionManager.cs
index 34ffceebd..b1d513dd4 100644
--- a/Emby.Server.Implementations/Session/SessionManager.cs
+++ b/Emby.Server.Implementations/Session/SessionManager.cs
@@ -1389,6 +1389,12 @@ namespace Emby.Server.Implementations.Session
}
}
+ if (user == null)
+ {
+ AuthenticationFailed?.Invoke(this, new GenericEventArgs<AuthenticationRequest>(request));
+ throw new SecurityException("Invalid user or password entered.");
+ }
+
if (enforcePassword)
{
user = await _userManager.AuthenticateUser(
@@ -1399,13 +1405,6 @@ namespace Emby.Server.Implementations.Session
true).ConfigureAwait(false);
}
- if (user == null)
- {
- AuthenticationFailed?.Invoke(this, new GenericEventArgs<AuthenticationRequest>(request));
-
- throw new SecurityException("Invalid user or password entered.");
- }
-
var token = GetAuthorizationToken(user, request.DeviceId, request.App, request.AppVersion, request.DeviceName);
var session = LogSessionActivity(