diff options
| author | crobibero <cody@robibe.ro> | 2020-10-14 17:58:33 -0600 |
|---|---|---|
| committer | crobibero <cody@robibe.ro> | 2020-10-14 17:58:33 -0600 |
| commit | 39924f99927ae85b85095cfe9c2d7fb4ece7e75a (patch) | |
| tree | b6727c2049d711d4c720c9208db4a02bc758e8bd /Emby.Server.Implementations/HttpServer/Security/AuthService.cs | |
| parent | 8ffa14e6d3436cd6533bf43241c356f803b06845 (diff) | |
Allow apikey to authenticate as admin
Diffstat (limited to 'Emby.Server.Implementations/HttpServer/Security/AuthService.cs')
| -rw-r--r-- | Emby.Server.Implementations/HttpServer/Security/AuthService.cs | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/Emby.Server.Implementations/HttpServer/Security/AuthService.cs b/Emby.Server.Implementations/HttpServer/Security/AuthService.cs index 68d981ad1..50c5b5b79 100644 --- a/Emby.Server.Implementations/HttpServer/Security/AuthService.cs +++ b/Emby.Server.Implementations/HttpServer/Security/AuthService.cs @@ -19,12 +19,7 @@ namespace Emby.Server.Implementations.HttpServer.Security public AuthorizationInfo Authenticate(HttpRequest request) { var auth = _authorizationContext.GetAuthorizationInfo(request); - if (auth?.User == null) - { - return null; - } - - if (auth.User.HasPermission(PermissionKind.IsDisabled)) + if (auth.User?.HasPermission(PermissionKind.IsDisabled) ?? false) { throw new SecurityException("User account has been disabled."); } |
