Explorar o código

log requests even without a user

Luke Pulverenti %!s(int64=12) %!d(string=hai) anos
pai
achega
2ea9b7e4eb
Modificáronse 1 ficheiros con 3 adicións e 5 borrados
  1. 3 5
      MediaBrowser.Api/BaseApiService.cs

+ 3 - 5
MediaBrowser.Api/BaseApiService.cs

@@ -122,15 +122,13 @@ namespace MediaBrowser.Api
 
 
             var auth = GetAuthorization(request);
             var auth = GetAuthorization(request);
 
 
-            if (auth != null && auth.ContainsKey("UserId"))
+            if (auth != null)
             {
             {
-                var userId = auth["UserId"];
-
                 User user = null;
                 User user = null;
 
 
-                if (!string.IsNullOrEmpty(userId))
+                if (auth.ContainsKey("UserId"))
                 {
                 {
-                    user = UserManager.GetUserById(new Guid(userId));
+                    user = UserManager.GetUserById(new Guid(auth["UserId"]));
                 }
                 }
 
 
                 var deviceId = auth["DeviceId"];
                 var deviceId = auth["DeviceId"];