fix(routing): fix store login 404 caused by CMS catch-all route priority

The CMS catch-all route /{store_code}/{slug} was registered before tenancy's
/{store_code}/login because modules are discovered alphabetically (cms before
tenancy). Also fix login.js store code extraction for /platforms/{code}/store/...
URL pattern.

- Add ROUTE_CONFIG priority=100 to CMS store pages so catch-all registers last
- Sort get_store_page_routes() by priority (matching other route getters)
- Use indexOf('store') in login.js to support platform-prefixed URLs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-08 20:30:16 +01:00
parent 55751d95b9
commit 7feacd5af8
3 changed files with 21 additions and 5 deletions

View File

@@ -286,8 +286,15 @@ def get_page_routes() -> list[RouteInfo]:
def get_store_page_routes() -> list[RouteInfo]:
"""Get store page routes from modules."""
return [r for r in discover_module_routes() if r.route_type == "pages" and r.frontend == "store"]
"""
Get store page routes from modules, sorted by priority.
Returns routes sorted by priority (lower first, higher last).
This ensures catch-all routes (priority 100+) are registered after
specific routes.
"""
routes = [r for r in discover_module_routes() if r.route_type == "pages" and r.frontend == "store"]
return sorted(routes, key=lambda r: r.priority)
def get_admin_page_routes() -> list[RouteInfo]: