1
0
Fork 0
mirror of synced 2024-09-28 07:11:40 +12:00
budibase/packages/worker/src/api/routes/auth.js

20 lines
519 B
JavaScript
Raw Normal View History

2021-04-08 22:57:23 +12:00
const Router = require("@koa/router")
2021-04-11 22:35:55 +12:00
const { passport } = require("@budibase/auth")
2021-04-08 22:57:23 +12:00
const authController = require("../controllers/auth")
const router = Router()
2021-04-11 22:35:55 +12:00
router
.post("/api/admin/auth", authController.authenticate)
2021-04-14 00:56:28 +12:00
.post("/api/admin/auth/logout", authController.logout)
2021-04-11 22:35:55 +12:00
.get("/api/auth/google", passport.authenticate("google"))
.get(
"/api/auth/google/callback",
passport.authenticate("google", {
successRedirect: "/app",
failureRedirect: "/",
})
)
2021-04-08 22:57:23 +12:00
module.exports = router