feat: Light mode default, auth, Posts rename, display scaling, TinyMCE improvements

This commit is contained in:
Jess Rogerson
2026-05-21 14:22:46 +10:00
parent 51d086dab9
commit 39fcd9ec6e
154 changed files with 12897 additions and 133 deletions
+1 -8
View File
@@ -1,14 +1,10 @@
using NoticeBoard.Data;
using Microsoft.EntityFrameworkCore;
namespace NoticeBoard.Routing;
public class DeviceSlugConstraint : IRouteConstraint
{
// Reserved paths that should NOT be treated as device slugs
private static readonly HashSet<string> ReservedPaths = new(StringComparer.OrdinalIgnoreCase)
{
"admin", "api", "d", "error", "css", "js", "lib", "uploads", "favicon.ico"
"admin", "api", "account", "d", "error", "css", "js", "lib", "uploads", "favicon.ico"
};
public bool Match(HttpContext? httpContext, IRouter? route, string routeKey,
@@ -16,11 +12,8 @@ public class DeviceSlugConstraint : IRouteConstraint
{
if (values.TryGetValue(routeKey, out var value) && value is string slug)
{
// Block reserved paths
if (ReservedPaths.Contains(slug))
return false;
// Only match lowercase alphanumeric + hyphens
return slug.All(c => char.IsLetterOrDigit(c) || c == '-');
}
return false;