aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Barron <barronpm@gmail.com>2023-11-22 09:40:49 -0500
committerPatrick Barron <barronpm@gmail.com>2023-11-22 09:40:49 -0500
commitad58d1f77c2039a62b225545fb795d3395046303 (patch)
tree7a77d79c2bab68b048067208636b23af752075cf
parentc9c133bc43231609a237291ae40ecb57bfc2576d (diff)
Use ExecuteDelete for removing API keys
-rw-r--r--Jellyfin.Server.Implementations/Security/AuthenticationManager.cs13
1 files changed, 2 insertions, 11 deletions
diff --git a/Jellyfin.Server.Implementations/Security/AuthenticationManager.cs b/Jellyfin.Server.Implementations/Security/AuthenticationManager.cs
index b2dfe60a1..07ac27e3c 100644
--- a/Jellyfin.Server.Implementations/Security/AuthenticationManager.cs
+++ b/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);
}
}
}