diff options
| author | Shadowghost <Ghost_of_Stone@web.de> | 2022-12-07 17:40:24 +0100 |
|---|---|---|
| committer | Shadowghost <Ghost_of_Stone@web.de> | 2022-12-07 17:40:24 +0100 |
| commit | 2c86bd1875e6e85d5867618e992d850453dae663 (patch) | |
| tree | 671070fb246fd3821bf6f1e58a01c402a2f969d1 /Jellyfin.Server.Implementations/Security/AuthorizationContext.cs | |
| parent | dd5f90802e71083347b6095eb79a9de0b9d34615 (diff) | |
| parent | 3cb7fe50127b1a8158186b390836ee25ae5a50fd (diff) | |
Merge branch 'master' into network-rewrite
Diffstat (limited to 'Jellyfin.Server.Implementations/Security/AuthorizationContext.cs')
| -rw-r--r-- | Jellyfin.Server.Implementations/Security/AuthorizationContext.cs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Jellyfin.Server.Implementations/Security/AuthorizationContext.cs b/Jellyfin.Server.Implementations/Security/AuthorizationContext.cs index 4d1a1b3cf..ec5742bab 100644 --- a/Jellyfin.Server.Implementations/Security/AuthorizationContext.cs +++ b/Jellyfin.Server.Implementations/Security/AuthorizationContext.cs @@ -32,7 +32,7 @@ namespace Jellyfin.Server.Implementations.Security public Task<AuthorizationInfo> GetAuthorizationInfo(HttpContext requestContext) { - if (requestContext.Request.HttpContext.Items.TryGetValue("AuthorizationInfo", out var cached) && cached != null) + if (requestContext.Request.HttpContext.Items.TryGetValue("AuthorizationInfo", out var cached) && cached is not null) { return Task.FromResult((AuthorizationInfo)cached); // Cache should never contain null } @@ -72,7 +72,7 @@ namespace Jellyfin.Server.Implementations.Security string? version = null; string? token = null; - if (auth != null) + if (auth is not null) { auth.TryGetValue("DeviceId", out deviceId); auth.TryGetValue("Device", out deviceName); @@ -127,7 +127,7 @@ namespace Jellyfin.Server.Implementations.Security { var device = await dbContext.Devices.FirstOrDefaultAsync(d => d.AccessToken == token).ConfigureAwait(false); - if (device != null) + if (device is not null) { authInfo.IsAuthenticated = true; var updateToken = false; @@ -189,7 +189,7 @@ namespace Jellyfin.Server.Implementations.Security else { var key = await dbContext.ApiKeys.FirstOrDefaultAsync(apiKey => apiKey.AccessToken == token).ConfigureAwait(false); - if (key != null) + if (key is not null) { authInfo.IsAuthenticated = true; authInfo.Client = key.Name; |
