mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-02-06 04:32:24 +00:00
fix web socket session creation
This commit is contained in:
@@ -1341,8 +1341,19 @@ namespace MediaBrowser.Server.Implementations.Session
|
||||
|
||||
private async Task<AuthenticationResult> AuthenticateNewSessionInternal(AuthenticationRequest request, bool enforcePassword)
|
||||
{
|
||||
var user = _userManager.Users
|
||||
.FirstOrDefault(i => string.Equals(request.Username, i.Name, StringComparison.OrdinalIgnoreCase));
|
||||
User user = null;
|
||||
if (!string.IsNullOrWhiteSpace(request.UserId))
|
||||
{
|
||||
var idGuid = new Guid(request.UserId);
|
||||
user = _userManager.Users
|
||||
.FirstOrDefault(i => i.Id == idGuid);
|
||||
}
|
||||
|
||||
if (user == null)
|
||||
{
|
||||
user = _userManager.Users
|
||||
.FirstOrDefault(i => string.Equals(request.Username, i.Name, StringComparison.OrdinalIgnoreCase));
|
||||
}
|
||||
|
||||
if (user != null && !string.IsNullOrWhiteSpace(request.DeviceId))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user