fix(server): fixes auth errors not logging to elmah

This commit is contained in:
2026-07-18 17:26:33 +02:00
parent f0703be115
commit 6716377fe2
2 changed files with 50 additions and 1 deletions
+10
View File
@@ -155,6 +155,16 @@ app.Use(async (context, next) =>
{
rateLimiter.RecordFailure(ip, context.Request.Path);
}
else if (location is not null
&& location.StartsWith("/admin", StringComparison.OrdinalIgnoreCase))
{
rateLimiter.RecordSuccess(ip);
}
}
else if (context.Response.StatusCode is >= 200 and < 300
&& context.Request.Path.StartsWithSegments("/api/admin"))
{
rateLimiter.RecordSuccess(ip);
}
return Task.CompletedTask;