Update index.js
Browse files
index.js
CHANGED
|
@@ -513,14 +513,22 @@ const detectSuspiciousISP = async (ip) => {
|
|
| 513 |
}
|
| 514 |
};
|
| 515 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 516 |
const initializeAdmin = async () => {
|
| 517 |
try {
|
|
|
|
| 518 |
let admin = await User.findOne({ username: 'HERXA' });
|
| 519 |
if (!admin) {
|
| 520 |
admin = new User({
|
| 521 |
username: 'HERXA',
|
| 522 |
email: 'admin@dashx.com',
|
| 523 |
-
password:
|
| 524 |
apikey: 'DHX-M3SA',
|
| 525 |
profileUrl: 'https://files.catbox.moe/8l6hhm',
|
| 526 |
verified: true,
|
|
|
|
| 513 |
}
|
| 514 |
};
|
| 515 |
|
| 516 |
+
async function hashPassword() {
|
| 517 |
+
const password = process.env.DEFAULT_PASSWORD;
|
| 518 |
+
const hashedPassword = await bcrypt.hash(password, 12);
|
| 519 |
+
console.log(hashedPassword);
|
| 520 |
+
return hashedPassword;
|
| 521 |
+
}
|
| 522 |
+
|
| 523 |
const initializeAdmin = async () => {
|
| 524 |
try {
|
| 525 |
+
const hashedPassword = await bcrypt.hash(process.env.DEFAULT_PASSWORD, 12);
|
| 526 |
let admin = await User.findOne({ username: 'HERXA' });
|
| 527 |
if (!admin) {
|
| 528 |
admin = new User({
|
| 529 |
username: 'HERXA',
|
| 530 |
email: 'admin@dashx.com',
|
| 531 |
+
password: hashedPassword,
|
| 532 |
apikey: 'DHX-M3SA',
|
| 533 |
profileUrl: 'https://files.catbox.moe/8l6hhm',
|
| 534 |
verified: true,
|