Don't logout if deviceId is null.

pull/6038/head
crobibero 4 years ago
parent 6f3bd59aac
commit f53aa55bdb

@ -1540,23 +1540,26 @@ namespace Emby.Server.Implementations.Session
Limit = 1 Limit = 1
}).Items.FirstOrDefault(); }).Items.FirstOrDefault();
var allExistingForDevice = _authRepo.Get( if (!string.IsNullOrEmpty(deviceId))
new AuthenticationInfoQuery
{
DeviceId = deviceId
}).Items;
foreach (var auth in allExistingForDevice)
{ {
if (existing == null || !string.Equals(auth.AccessToken, existing.AccessToken, StringComparison.Ordinal)) var allExistingForDevice = _authRepo.Get(
{ new AuthenticationInfoQuery
try
{ {
Logout(auth); DeviceId = deviceId
} }).Items;
catch (Exception ex)
foreach (var auth in allExistingForDevice)
{
if (existing == null || !string.Equals(auth.AccessToken, existing.AccessToken, StringComparison.Ordinal))
{ {
_logger.LogError(ex, "Error while logging out."); try
{
Logout(auth);
}
catch (Exception ex)
{
_logger.LogError(ex, "Error while logging out.");
}
} }
} }
} }

Loading…
Cancel
Save