mirror of
https://github.com/dec0dOS/zero-ui.git
synced 2025-07-06 04:51:44 -07:00
feat: es6+mods
This commit is contained in:
parent
773b64ea30
commit
19c92ed244
19 changed files with 179 additions and 245 deletions
|
@ -1,7 +1,7 @@
|
|||
const crypto = require("crypto");
|
||||
const hashPassword = require("pbkdf2-wrapper/hashText");
|
||||
import crypto from "crypto";
|
||||
import hashPassword from "pbkdf2-wrapper/hashText.js";
|
||||
|
||||
module.exports = async function () {
|
||||
export async function initAdmin() {
|
||||
if (!process.env.ZU_DEFAULT_PASSWORD || !process.env.ZU_DEFAULT_USERNAME) {
|
||||
console.error("ZU_DEFAULT_PASSWORD or ZU_DEFAULT_USERNAME not found!");
|
||||
process.exit(1);
|
||||
|
@ -13,4 +13,4 @@ module.exports = async function () {
|
|||
password_hash: hash,
|
||||
token: crypto.randomBytes(16).toString("hex"),
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue