From 09ea9162763d137707fc64022dfc2e742aa184b6 Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 23 Nov 2018 09:22:45 +0900 Subject: [PATCH] Delete reset-password.js --- cli/reset-password.js | 29 ----------------------------- 1 file changed, 29 deletions(-) delete mode 100644 cli/reset-password.js diff --git a/cli/reset-password.js b/cli/reset-password.js deleted file mode 100644 index d94c90f3d..000000000 --- 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); -});