diff --git a/packages/worker/src/api/controllers/admin/auth.js b/packages/worker/src/api/controllers/auth.js similarity index 100% rename from packages/worker/src/api/controllers/admin/auth.js rename to packages/worker/src/api/controllers/auth.js diff --git a/packages/worker/src/api/routes/admin/index.js b/packages/worker/src/api/routes/admin/index.js index 1c64110d2a..2c56f67f3f 100644 --- a/packages/worker/src/api/routes/admin/index.js +++ b/packages/worker/src/api/routes/admin/index.js @@ -1,14 +1,11 @@ const Router = require("@koa/router") -const passport = require("@budibase/auth") const controller = require("../../controllers/admin") -const authController = require("../../controllers/admin/auth") const authenticated = require("../../../middleware/authenticated") const router = Router() router .post("/api/admin/users", authenticated, controller.userSave) - .post("/api/admin/authenticate", authController.authenticate) .delete("/api/admin/users/:email", authenticated, controller.userDelete) .get("/api/admin/users", authenticated, controller.userFetch) .get("/api/admin/users/:email", authenticated, controller.userFind) diff --git a/packages/worker/src/api/routes/auth.js b/packages/worker/src/api/routes/auth.js new file mode 100644 index 0000000000..d40071b774 --- /dev/null +++ b/packages/worker/src/api/routes/auth.js @@ -0,0 +1,8 @@ +const Router = require("@koa/router") +const authController = require("../controllers/auth") + +const router = Router() + +router.post("/api/auth/authenticate", authController.authenticate) + +module.exports = router diff --git a/packages/worker/src/api/routes/index.js b/packages/worker/src/api/routes/index.js index 076710b21b..c6bacc81e5 100644 --- a/packages/worker/src/api/routes/index.js +++ b/packages/worker/src/api/routes/index.js @@ -1,4 +1,5 @@ const adminRoutes = require("./admin") +const authRoutes = require("./auth") const appRoutes = require("./app") -exports.routes = [adminRoutes, appRoutes] +exports.routes = [adminRoutes, authRoutes, appRoutes]