Clean up UserManager.AuthenticateUser
This commit is contained in:
parent
f8283d8c20
commit
a5e55ba859
|
@ -402,27 +402,18 @@ namespace Jellyfin.Server.Implementations.Users
|
||||||
}
|
}
|
||||||
|
|
||||||
var user = Users.FirstOrDefault(i => string.Equals(username, i.Username, StringComparison.OrdinalIgnoreCase));
|
var user = Users.FirstOrDefault(i => string.Equals(username, i.Username, StringComparison.OrdinalIgnoreCase));
|
||||||
bool success;
|
|
||||||
IAuthenticationProvider? authenticationProvider;
|
|
||||||
|
|
||||||
if (user != null)
|
|
||||||
{
|
|
||||||
var authResult = await AuthenticateLocalUser(username, password, user, remoteEndPoint)
|
var authResult = await AuthenticateLocalUser(username, password, user, remoteEndPoint)
|
||||||
.ConfigureAwait(false);
|
.ConfigureAwait(false);
|
||||||
authenticationProvider = authResult.authenticationProvider;
|
var authenticationProvider = authResult.authenticationProvider;
|
||||||
success = authResult.success;
|
var success = authResult.success;
|
||||||
}
|
|
||||||
else
|
if (user is null)
|
||||||
{
|
{
|
||||||
var authResult = await AuthenticateLocalUser(username, password, null, remoteEndPoint)
|
|
||||||
.ConfigureAwait(false);
|
|
||||||
authenticationProvider = authResult.authenticationProvider;
|
|
||||||
string updatedUsername = authResult.username;
|
string updatedUsername = authResult.username;
|
||||||
success = authResult.success;
|
|
||||||
|
|
||||||
if (success
|
if (success
|
||||||
&& authenticationProvider != null
|
&& authenticationProvider is not null
|
||||||
&& !(authenticationProvider is DefaultAuthenticationProvider))
|
&& authenticationProvider is not DefaultAuthenticationProvider)
|
||||||
{
|
{
|
||||||
// Trust the username returned by the authentication provider
|
// Trust the username returned by the authentication provider
|
||||||
username = updatedUsername;
|
username = updatedUsername;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user