diff options
| author | Cromefire_ <26320625+cromefire@users.noreply.github.com> | 2019-12-13 15:27:12 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-12-13 15:27:12 +0100 |
| commit | 6231fc18eac67966340fddc121dc2895fd99ab5e (patch) | |
| tree | 406f91c86aa45598325c2762abd115007c9c07d0 | |
| parent | 96a5dda9ffe714e170e97bb93d72d68ed55791bb (diff) | |
Fixed invalid username handling
| -rw-r--r-- | Emby.Server.Implementations/Session/SessionManager.cs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Emby.Server.Implementations/Session/SessionManager.cs b/Emby.Server.Implementations/Session/SessionManager.cs index b87ca3a11..80079ae6c 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<AuthenticationRequest>(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<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( |
