فهرست منبع

Use ExecuteDelete for removing API keys

Patrick Barron 1 سال پیش
والد
کامیت
ad58d1f77c
1فایلهای تغییر یافته به همراه2 افزوده شده و 11 حذف شده
  1. 2 11
      Jellyfin.Server.Implementations/Security/AuthenticationManager.cs

+ 2 - 11
Jellyfin.Server.Implementations/Security/AuthenticationManager.cs

@@ -58,19 +58,10 @@ namespace Jellyfin.Server.Implementations.Security
             var dbContext = await _dbProvider.CreateDbContextAsync().ConfigureAwait(false);
             await using (dbContext.ConfigureAwait(false))
             {
-                var key = await dbContext.ApiKeys
+                await dbContext.ApiKeys
                     .Where(apiKey => apiKey.AccessToken == accessToken)
-                    .FirstOrDefaultAsync()
+                    .ExecuteDeleteAsync()
                     .ConfigureAwait(false);
-
-                if (key is null)
-                {
-                    return;
-                }
-
-                dbContext.Remove(key);
-
-                await dbContext.SaveChangesAsync().ConfigureAwait(false);
             }
         }
     }