aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts/reset-password.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-02-14 13:17:10 +0100
committerChocobozzz <me@florianbigard.com>2019-02-14 13:17:10 +0100
commit98d33a03d3a86aad709e2cd39a4e4d8bac6b7664 (patch)
treed8e1e8d21054fc4d966c009bdd05333a2a6e44cb /scripts/reset-password.ts
parent73471b1a52f242e86364ffb077ea6cadb3b07ae2 (diff)
parent340f31ce96c456942fb01800f31d795e0f355d74 (diff)
downloadPeerTube-98d33a03d3a86aad709e2cd39a4e4d8bac6b7664.tar.gz
PeerTube-98d33a03d3a86aad709e2cd39a4e4d8bac6b7664.tar.zst
PeerTube-98d33a03d3a86aad709e2cd39a4e4d8bac6b7664.zip
Merge branch 'release/v1.2.0'
Diffstat (limited to 'scripts/reset-password.ts')
-rwxr-xr-xscripts/reset-password.ts6
1 files changed, 6 insertions, 0 deletions
diff --git a/scripts/reset-password.ts b/scripts/reset-password.ts
index 6516edc28..4a9037280 100755
--- a/scripts/reset-password.ts
+++ b/scripts/reset-password.ts
@@ -1,6 +1,7 @@
1import * as program from 'commander' 1import * as program from 'commander'
2import { initDatabaseModels } from '../server/initializers' 2import { initDatabaseModels } from '../server/initializers'
3import { UserModel } from '../server/models/account/user' 3import { UserModel } from '../server/models/account/user'
4import { isUserPasswordValid } from '../server/helpers/custom-validators/users'
4 5
5program 6program
6 .option('-u, --user [user]', 'User') 7 .option('-u, --user [user]', 'User')
@@ -36,6 +37,11 @@ initDatabaseModels(true)
36 37
37 console.log('New password?') 38 console.log('New password?')
38 rl.on('line', function (password) { 39 rl.on('line', function (password) {
40 if (!isUserPasswordValid(password)) {
41 console.error('New password is invalid.')
42 process.exit(-1)
43 }
44
39 user.password = password 45 user.password = password
40 46
41 user.save() 47 user.save()