move auth controller into it's own dir
This commit is contained in:
parent
4abe6192dc
commit
2077073986
|
@ -1,14 +1,11 @@
|
||||||
const Router = require("@koa/router")
|
const Router = require("@koa/router")
|
||||||
const passport = require("@budibase/auth")
|
|
||||||
const controller = require("../../controllers/admin")
|
const controller = require("../../controllers/admin")
|
||||||
const authController = require("../../controllers/admin/auth")
|
|
||||||
const authenticated = require("../../../middleware/authenticated")
|
const authenticated = require("../../../middleware/authenticated")
|
||||||
|
|
||||||
const router = Router()
|
const router = Router()
|
||||||
|
|
||||||
router
|
router
|
||||||
.post("/api/admin/users", authenticated, controller.userSave)
|
.post("/api/admin/users", authenticated, controller.userSave)
|
||||||
.post("/api/admin/authenticate", authController.authenticate)
|
|
||||||
.delete("/api/admin/users/:email", authenticated, controller.userDelete)
|
.delete("/api/admin/users/:email", authenticated, controller.userDelete)
|
||||||
.get("/api/admin/users", authenticated, controller.userFetch)
|
.get("/api/admin/users", authenticated, controller.userFetch)
|
||||||
.get("/api/admin/users/:email", authenticated, controller.userFind)
|
.get("/api/admin/users/:email", authenticated, controller.userFind)
|
||||||
|
|
|
@ -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
|
|
@ -1,4 +1,5 @@
|
||||||
const adminRoutes = require("./admin")
|
const adminRoutes = require("./admin")
|
||||||
|
const authRoutes = require("./auth")
|
||||||
const appRoutes = require("./app")
|
const appRoutes = require("./app")
|
||||||
|
|
||||||
exports.routes = [adminRoutes, appRoutes]
|
exports.routes = [adminRoutes, authRoutes, appRoutes]
|
||||||
|
|
Loading…
Reference in New Issue