aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/HttpServer/Security/AuthService.cs
diff options
context:
space:
mode:
authorcvium <clausvium@gmail.com>2020-11-08 16:10:33 +0100
committercvium <clausvium@gmail.com>2020-11-08 16:10:33 +0100
commite78c63c4dc819867acddc5a15a7d7c02f7aa9b30 (patch)
treeb12386dc99328bd40bfcbf82eeea628eb8d77ad3 /Emby.Server.Implementations/HttpServer/Security/AuthService.cs
parent96dcd9c87e2eb4b14004368856949e9fde2db261 (diff)
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)