Merge pull request #3533 from barronpm/user-login-casing
Make User Authentication Case-insensitive and remove EF Core Log spam
This commit is contained in:
commit
29a386ee2d
|
@ -296,7 +296,7 @@ namespace Emby.Server.Implementations.Session
|
||||||
}
|
}
|
||||||
catch (DbUpdateConcurrencyException e)
|
catch (DbUpdateConcurrencyException e)
|
||||||
{
|
{
|
||||||
_logger.LogWarning(e, "Error updating user's last activity date.");
|
_logger.LogDebug(e, "Error updating user's last activity date.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -110,9 +110,8 @@ namespace Jellyfin.Server.Implementations.Users
|
||||||
throw new ArgumentException("Invalid username", nameof(name));
|
throw new ArgumentException("Invalid username", nameof(name));
|
||||||
}
|
}
|
||||||
|
|
||||||
// This can't use an overload with StringComparer because that would cause the query to
|
return _dbProvider.CreateContext().Users.AsEnumerable()
|
||||||
// have to be evaluated client-side.
|
.FirstOrDefault(u => string.Equals(u.Username, name, StringComparison.OrdinalIgnoreCase));
|
||||||
return _dbProvider.CreateContext().Users.FirstOrDefault(u => string.Equals(u.Username, name));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
|
@ -381,7 +380,7 @@ namespace Jellyfin.Server.Implementations.Users
|
||||||
throw new ArgumentNullException(nameof(username));
|
throw new ArgumentNullException(nameof(username));
|
||||||
}
|
}
|
||||||
|
|
||||||
var user = Users.ToList().FirstOrDefault(i => string.Equals(username, i.Username, StringComparison.OrdinalIgnoreCase));
|
var user = Users.AsEnumerable().FirstOrDefault(i => string.Equals(username, i.Username, StringComparison.OrdinalIgnoreCase));
|
||||||
bool success;
|
bool success;
|
||||||
IAuthenticationProvider? authenticationProvider;
|
IAuthenticationProvider? authenticationProvider;
|
||||||
|
|
||||||
|
@ -409,8 +408,7 @@ namespace Jellyfin.Server.Implementations.Users
|
||||||
|
|
||||||
// Search the database for the user again
|
// Search the database for the user again
|
||||||
// the authentication provider might have created it
|
// the authentication provider might have created it
|
||||||
user = Users
|
user = Users.AsEnumerable().FirstOrDefault(i => string.Equals(username, i.Username, StringComparison.OrdinalIgnoreCase));
|
||||||
.ToList().FirstOrDefault(i => string.Equals(username, i.Username, StringComparison.OrdinalIgnoreCase));
|
|
||||||
|
|
||||||
if (authenticationProvider is IHasNewUserPolicy hasNewUserPolicy)
|
if (authenticationProvider is IHasNewUserPolicy hasNewUserPolicy)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue
Block a user