diff options
Diffstat (limited to 'MediaBrowser.Server.Implementations/Session/SessionManager.cs')
| -rw-r--r-- | MediaBrowser.Server.Implementations/Session/SessionManager.cs | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/MediaBrowser.Server.Implementations/Session/SessionManager.cs b/MediaBrowser.Server.Implementations/Session/SessionManager.cs index 77843ef6b..098fe0b4d 100644 --- a/MediaBrowser.Server.Implementations/Session/SessionManager.cs +++ b/MediaBrowser.Server.Implementations/Session/SessionManager.cs @@ -404,6 +404,10 @@ namespace MediaBrowser.Server.Implementations.Session /// <returns>SessionInfo.</returns> private async Task<SessionInfo> GetSessionInfo(string appName, string appVersion, string deviceId, string deviceName, string remoteEndPoint, User user) { + if (string.IsNullOrWhiteSpace(deviceId)) + { + throw new ArgumentNullException("deviceId"); + } var key = GetSessionKey(appName, deviceId); await _sessionLock.WaitAsync(CancellationToken.None).ConfigureAwait(false); @@ -1447,7 +1451,7 @@ namespace MediaBrowser.Server.Implementations.Session } } - public async Task RevokeUserTokens(string userId) + public async Task RevokeUserTokens(string userId, string currentAccessToken) { var existing = _authRepo.Get(new AuthenticationInfoQuery { @@ -1457,7 +1461,10 @@ namespace MediaBrowser.Server.Implementations.Session foreach (var info in existing.Items) { - await Logout(info.AccessToken).ConfigureAwait(false); + if (!string.Equals(currentAccessToken, info.AccessToken, StringComparison.OrdinalIgnoreCase)) + { + await Logout(info.AccessToken).ConfigureAwait(false); + } } } @@ -1748,6 +1755,11 @@ namespace MediaBrowser.Server.Implementations.Session public void ReportNowViewingItem(string sessionId, string itemId) { + if (string.IsNullOrWhiteSpace(itemId)) + { + throw new ArgumentNullException("itemId"); + } + var item = _libraryManager.GetItemById(new Guid(itemId)); var info = GetItemInfo(item, null, null); |
