diff options
| author | Claus Vium <cvium@users.noreply.github.com> | 2020-11-11 10:47:18 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-11-11 10:47:18 +0100 |
| commit | a7b3880d0e0cff58bb28a668e4552398c08e7849 (patch) | |
| tree | eecba5e24e0bcce512511c6f8331e20d82a7794c /Emby.Server.Implementations/HttpServer/Security/AuthService.cs | |
| parent | b99519898d2c9e8ba3020e11892718f1eca37c66 (diff) | |
| parent | 0c45faf100d226a00c07e785aa55e22ec55bda9c (diff) | |
Merge branch 'master' into fix_and_mildly_improve_similar
Diffstat (limited to 'Emby.Server.Implementations/HttpServer/Security/AuthService.cs')
| -rw-r--r-- | Emby.Server.Implementations/HttpServer/Security/AuthService.cs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Emby.Server.Implementations/HttpServer/Security/AuthService.cs b/Emby.Server.Implementations/HttpServer/Security/AuthService.cs index 7d53e886f..df7a034e8 100644 --- a/Emby.Server.Implementations/HttpServer/Security/AuthService.cs +++ b/Emby.Server.Implementations/HttpServer/Security/AuthService.cs @@ -1,6 +1,7 @@ #pragma warning disable CS1591 using Jellyfin.Data.Enums; +using MediaBrowser.Controller.Authentication; using MediaBrowser.Controller.Net; using Microsoft.AspNetCore.Http; @@ -19,9 +20,9 @@ namespace Emby.Server.Implementations.HttpServer.Security public AuthorizationInfo Authenticate(HttpRequest request) { var auth = _authorizationContext.GetAuthorizationInfo(request); - if (auth == null) + if (!auth.IsAuthenticated) { - throw new SecurityException("Unauthenticated request."); + throw new AuthenticationException("Invalid token."); } if (auth.User?.HasPermission(PermissionKind.IsDisabled) ?? false) |
