mirror of
https://github.com/dec0dOS/zero-ui.git
synced 2025-07-06 21:11:41 -07:00
feat: es6+mods
This commit is contained in:
parent
773b64ea30
commit
19c92ed244
19 changed files with 179 additions and 245 deletions
|
@ -1,8 +1,7 @@
|
|||
const db = require("../utils/db");
|
||||
const verifyHash = require("pbkdf2-wrapper/verifyHash");
|
||||
import { db } from "../utils/db.js";
|
||||
import verifyHash from "pbkdf2-wrapper/verifyHash.js";
|
||||
|
||||
exports.authorize = authorize;
|
||||
async function authorize(username, password, callback) {
|
||||
export async function authorize(username, password, callback) {
|
||||
try {
|
||||
var users = await db.get("users");
|
||||
} catch (err) {
|
||||
|
@ -18,8 +17,7 @@ async function authorize(username, password, callback) {
|
|||
}
|
||||
}
|
||||
|
||||
exports.isAuthorized = isAuthorized;
|
||||
async function isAuthorized(req, res, next) {
|
||||
export async function isAuthorized(req, res, next) {
|
||||
if (process.env.ZU_DISABLE_AUTH === "true") {
|
||||
next();
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue