const express = require("express") const authService = require("../../../../services/authService") const router = express.Router() router.post("/", authService.isNotLogged, async (req, res) => { if (process.env.LOGIN_ENABLED != "true") { return res.status(401).json({ error: "login_disabled", error_description: "The administrator has disabled internal login." }) } const { identifier, password } = req.body const user = await authService.loginLocal({ identifier, password }) return res.status(201).json(user) }) module.exports = router