Fixed invalid username handling

pull/2146/head
Cromefire_ 5 years ago committed by GitHub
parent 96a5dda9ff
commit 6231fc18ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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

Loading…
Cancel
Save