mirror of
https://github.com/dec0dOS/zero-ui.git
synced 2025-07-06 04:51:44 -07:00
feat: disable auth (#59)
This commit is contained in:
parent
30069a699f
commit
e7fb4d0aa8
3 changed files with 33 additions and 8 deletions
|
@ -3,6 +3,14 @@ const router = express.Router();
|
|||
|
||||
const auth = require("../services/auth");
|
||||
|
||||
router.get("/login", async function (req, res) {
|
||||
if (process.env.ZU_DISABLE_AUTH === "true") {
|
||||
res.send({ enabled: false });
|
||||
} else {
|
||||
res.send({ enabled: true });
|
||||
}
|
||||
});
|
||||
|
||||
router.post("/login", async function (req, res) {
|
||||
if (req.body.username && req.body.password) {
|
||||
auth.authorize(req.body.username, req.body.password, function (err, user) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue