summaryrefslogtreecommitdiff
path: root/cli
diff options
context:
space:
mode:
Diffstat (limited to 'cli')
-rw-r--r--cli/reset-password.js29
1 files changed, 0 insertions, 29 deletions
diff --git a/cli/reset-password.js b/cli/reset-password.js
deleted file mode 100644
index d94c90f3d5..0000000000
--- a/cli/reset-password.js
+++ /dev/null
@@ -1,29 +0,0 @@
-const mongo = require('mongodb');
-const bcrypt = require('bcryptjs');
-const User = require('../built/models/user').default;
-
-const args = process.argv.slice(2);
-
-const user = args[0];
-
-const q = user.startsWith('@') ? {
- username: user.split('@')[1],
- host: user.split('@')[2] || null
-} : { _id: new mongo.ObjectID(user) };
-
-console.log(`Resetting password for ${user}...`);
-
-const passwd = 'yo';
-
-// Generate hash of password
-const hash = bcrypt.hashSync(passwd);
-
-User.update(q, {
- $set: {
- password: hash
- }
-}).then(() => {
- console.log(`Password of ${user} is now '${passwd}'`);
-}, e => {
- console.error(e);
-});