Merge pull request #6038 from crobibero/delete-existing-sessions
Don't logout if deviceId is null
This commit is contained in:
commit
1594385497
|
@ -1542,23 +1542,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
|
||||||
|
{
|
||||||
|
DeviceId = deviceId
|
||||||
|
}).Items;
|
||||||
|
|
||||||
|
foreach (var auth in allExistingForDevice)
|
||||||
{
|
{
|
||||||
try
|
if (existing == null || !string.Equals(auth.AccessToken, existing.AccessToken, StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
Logout(auth);
|
try
|
||||||
}
|
{
|
||||||
catch (Exception ex)
|
Logout(auth);
|
||||||
{
|
}
|
||||||
_logger.LogError(ex, "Error while logging out.");
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
_logger.LogError(ex, "Error while logging out.");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user