aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/HttpServer/Security/AuthService.cs
diff options
context:
space:
mode:
authorBond-009 <bond.009@outlook.com>2020-11-08 16:58:35 +0100
committerGitHub <noreply@github.com>2020-11-08 16:58:35 +0100
commitc8a320082f45a26e8a295a7c86822ddc9ed99d8a (patch)
treecf31efdc932a2571304e66150777f794c9950716 /Emby.Server.Implementations/HttpServer/Security/AuthService.cs
parent79719780812ee3d00b0dcf2e0d6e4659964e151d (diff)
parente78c63c4dc819867acddc5a15a7d7c02f7aa9b30 (diff)
Merge pull request #4443 from cvium/fix_auth_again_again_again
Remove OriginalAuthenticationInfo and add IsAuthenticated property
Diffstat (limited to 'Emby.Server.Implementations/HttpServer/Security/AuthService.cs')
-rw-r--r--Emby.Server.Implementations/HttpServer/Security/AuthService.cs5
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)