remove RequiresAuth property
This commit is contained in:
@@ -11,5 +11,4 @@ public class ApiMessageHandlerAttribute(string route, params string[] methods) :
|
|||||||
public string Route { get; } = route;
|
public string Route { get; } = route;
|
||||||
public string[] Methods { get; } = methods;
|
public string[] Methods { get; } = methods;
|
||||||
public Type? Serializer { get; set; }
|
public Type? Serializer { get; set; }
|
||||||
public bool RequiesAuth { get; set; }
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -484,7 +484,7 @@ public class ApiServer : IApiServer
|
|||||||
if (string.IsNullOrWhiteSpace(authKey) || DecodeAuthKey(authKey) is not string authKeyDecoded)
|
if (string.IsNullOrWhiteSpace(authKey) || DecodeAuthKey(authKey) is not string authKeyDecoded)
|
||||||
authKeyDecoded = null!;
|
authKeyDecoded = null!;
|
||||||
isAuthenticated = CheckAuthentication(authKeyDecoded, handler.Handler, context);
|
isAuthenticated = CheckAuthentication(authKeyDecoded, handler.Handler, context);
|
||||||
if (handler.Attribute.RequiesAuth && !isAuthenticated)
|
if (!isAuthenticated)
|
||||||
return new(ApiResult.Unauthorized(), null);
|
return new(ApiResult.Unauthorized(), null);
|
||||||
|
|
||||||
// Get required infos
|
// Get required infos
|
||||||
|
|||||||
Reference in New Issue
Block a user