Merge pull request #2146 from cromefire/patch-1

Fix invalid username handling
This commit is contained in:
Bond-009 2019-12-15 10:07:22 +01:00 committed by GitHub
commit b8c61a5c40
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 7 deletions

View File

@ -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(