feat: es6+mods and replace node-cron with croner

This commit is contained in:
Andres 2023-10-08 16:37:26 +02:00
parent 19c92ed244
commit ea828c326f
9 changed files with 10437 additions and 374 deletions

View file

@ -1,7 +1,7 @@
import express from "express";
const router = express.Router();
import { authorize } from "../services/auth.js";
import * as auth from "../services/auth.js";
router.get("/login", async function (req, res) {
if (process.env.ZU_DISABLE_AUTH === "true") {
@ -13,7 +13,7 @@ router.get("/login", async function (req, res) {
router.post("/login", async function (req, res) {
if (req.body.username && req.body.password) {
authorize(req.body.username, req.body.password, function (err, user) {
auth.authorize(req.body.username, req.body.password, function (err, user) {
if (user) {
res.send({ token: user["token"] });
} else {