Fixed invalid username handling

This commit is contained in:
Cromefire_
2019-12-13 15:27:12 +01:00
committed by GitHub
parent 96a5dda9ff
commit 6231fc18ea

View File

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