fix(admin): block default product variant routes without patching Medusa#994
fix(admin): block default product variant routes without patching Medusa#994wasin-creator wants to merge 1 commit into
Conversation
|
Update after route-loader investigation: This PR should be treated as not ready to merge as-is. The original goal was to remove For
Spike results:
Conclusion: full removal of Recommended next step: keep PR #992 as the production-safe fix and either close/rework this PR so it does not remove |
|
Closing this PR as not ready after the route-loader investigation.\n\nThe safe production path remains PR #992: use native Medusa CLI for dev/build while keeping on so still preserves the existing admin product route-disabling behavior.\n\nFull removal of is blocked for by Medusa v2 route-loader precedence. Details are documented in issue #993. |
|
Correction to the previous close comment (shell quoting stripped inline code): Closing this PR as not ready after the route-loader investigation. The safe production path remains PR #992: use native Medusa CLI for dev/build while keeping Full removal of |
Summary
Closes #993
Details
/admin/product-variants*in@mercurjs/coreadmin middleware.patchMedusa()frommercurjs start./admin/products*untouched because Mercur ownspackages/core/src/api/admin/products/route.ts; blocking that matcher needs a separate route matrix to avoid shadowing Mercur's replacement route.Verification
bun run test:integration:http -- admin/default-medusa-product-routesfailed before the blocker with expected 404 / received 403 after rebuilding core from main source.bun run test:integration:http -- admin/default-medusa-product-routespasses.bun run buildpasses: 10 successful / 10 total.cd apps/api && bun run devstarts on port 9000;/healthreturns HTTP 200; noCodegen failed/ command-not-found logs.cd apps/api && NODE_ENV=production bun run startstarts on port 9000;/healthreturns HTTP 200; no patch/command errors.Follow-up
/admin/products*route matrix separately before replacing the remaining product-route patch behavior, because Mercur already provides its own admin products route.