diff --git a/Pilz.Net/Api/ApiMessageHandlerAttribute.cs b/Pilz.Net/Api/ApiMessageHandlerAttribute.cs index 16e3725..d1f3b66 100644 --- a/Pilz.Net/Api/ApiMessageHandlerAttribute.cs +++ b/Pilz.Net/Api/ApiMessageHandlerAttribute.cs @@ -11,5 +11,4 @@ public class ApiMessageHandlerAttribute(string route, params string[] methods) : public string Route { get; } = route; public string[] Methods { get; } = methods; public Type? Serializer { get; set; } - public bool RequiesAuth { get; set; } } diff --git a/Pilz.Net/Api/ApiServer.cs b/Pilz.Net/Api/ApiServer.cs index 76b568e..e25ecbf 100644 --- a/Pilz.Net/Api/ApiServer.cs +++ b/Pilz.Net/Api/ApiServer.cs @@ -484,7 +484,7 @@ public class ApiServer : IApiServer if (string.IsNullOrWhiteSpace(authKey) || DecodeAuthKey(authKey) is not string authKeyDecoded) authKeyDecoded = null!; isAuthenticated = CheckAuthentication(authKeyDecoded, handler.Handler, context); - if (handler.Attribute.RequiesAuth && !isAuthenticated) + if (!isAuthenticated) return new(ApiResult.Unauthorized(), null); // Get required infos