Merge pull request #2146 from cromefire/patch-1

Fix invalid username handling
pull/2170/head
Bond-009 5 years ago committed by GitHub
commit b8c61a5c40
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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

Loading…
Cancel
Save