From c5da2cf1d20bf021175a5468b294a3833b04250d Mon Sep 17 00:00:00 2001 From: adrien2p Date: Fri, 6 Jan 2023 17:49:55 +0100 Subject: [PATCH] fix: admin api loader should register after the core auth router --- src/loaders/admin-api.loader.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/loaders/admin-api.loader.ts b/src/loaders/admin-api.loader.ts index 7a18c5cd..7df152ff 100644 --- a/src/loaders/admin-api.loader.ts +++ b/src/loaders/admin-api.loader.ts @@ -38,8 +38,8 @@ export async function adminApiLoader( const adminAuthRouteLoader = await import('@medusajs/medusa/dist/api/routes/admin/auth'); const originalAdminAuthRouteLoader = adminAuthRouteLoader.default; adminAuthRouteLoader.default = (app: Router): void => { + originalAdminAuthRouteLoader(app); applyMiddlewares('admin', app, adminMiddlewares); applyRouters('admin', app, adminRouters); - originalAdminAuthRouteLoader(app); }; }