website refactor
This commit is contained in:
@@ -94,9 +94,13 @@ export class WebsiteRouteManager {
|
||||
public getAccessLevel(pathTemplate: string): RouteAccess {
|
||||
// NOTE: `routeMatchers.isInGroup(path, 'public')` is prefix-based and will treat everything
|
||||
// as public because the home route is `/`. Use `isPublic()` for correct classification.
|
||||
|
||||
// Check public first to ensure public routes nested under protected prefixes (e.g. /sponsor/signup)
|
||||
// are correctly classified as public.
|
||||
if (routeMatchers.isPublic(pathTemplate)) return 'public';
|
||||
|
||||
if (routeMatchers.isInGroup(pathTemplate, 'admin')) return 'admin';
|
||||
if (routeMatchers.isInGroup(pathTemplate, 'sponsor')) return 'sponsor';
|
||||
if (routeMatchers.isPublic(pathTemplate)) return 'public';
|
||||
if (routeMatchers.requiresAuth(pathTemplate)) return 'auth';
|
||||
return 'public';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user