From 29a403cc6883c8d5878736b71cc1123c2b908ac0 Mon Sep 17 00:00:00 2001 From: "Fabien \"egg\" O'Carroll" Date: Fri, 9 Jun 2023 08:51:26 +0200 Subject: [PATCH] Supported a god_mode param in the Admin API This currently skips the not-implemented middleware and can be used to access experimental endpoints whilst in development. --- ghost/core/core/server/web/api/endpoints/admin/middleware.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ghost/core/core/server/web/api/endpoints/admin/middleware.js b/ghost/core/core/server/web/api/endpoints/admin/middleware.js index 7e22c71bbb..e7fb7e346f 100644 --- a/ghost/core/core/server/web/api/endpoints/admin/middleware.js +++ b/ghost/core/core/server/web/api/endpoints/admin/middleware.js @@ -14,6 +14,10 @@ const notImplemented = function (req, res, next) { return next(); } + if (req.query.god_mode === 'true' && process.env.NODE_ENV === 'development') { + return next(); + } + // @NOTE: integrations & staff tokens have limited access to the API const allowlisted = { site: ['GET'],