mirror of
https://github.com/dec0dOS/zero-ui.git
synced 2025-07-06 04:51:44 -07:00
feat: es6+mods and replace node-cron with croner
This commit is contained in:
parent
19c92ed244
commit
ea828c326f
9 changed files with 10437 additions and 374 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue