aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Api
diff options
context:
space:
mode:
authorCody Robibero <cody@robibe.ro>2021-11-13 07:27:28 -0700
committerCody Robibero <cody@robibe.ro>2021-11-13 07:27:28 -0700
commit4a28f46cac30e2e1fabc84016d710bcd309a5344 (patch)
tree3cae630deab87943278399c7e5161fa93a4a5d22 /Jellyfin.Api
parent8868b34d78bdb34f4c47aa4b8e81a1a3cd699ded (diff)
Don't throw exception on unauthenticated requests
Diffstat (limited to 'Jellyfin.Api')
-rw-r--r--Jellyfin.Api/Auth/CustomAuthenticationHandler.cs5
1 files changed, 5 insertions, 0 deletions
diff --git a/Jellyfin.Api/Auth/CustomAuthenticationHandler.cs b/Jellyfin.Api/Auth/CustomAuthenticationHandler.cs
index 369e846ae..bd3e7d9e3 100644
--- a/Jellyfin.Api/Auth/CustomAuthenticationHandler.cs
+++ b/Jellyfin.Api/Auth/CustomAuthenticationHandler.cs
@@ -45,6 +45,11 @@ namespace Jellyfin.Api.Auth
try
{
var authorizationInfo = await _authService.Authenticate(Request).ConfigureAwait(false);
+ if (!authorizationInfo.HasToken)
+ {
+ return AuthenticateResult.NoResult();
+ }
+
var role = UserRoles.User;
if (authorizationInfo.IsApiKey || authorizationInfo.User.HasPermission(PermissionKind.IsAdministrator))
{