Generate passwords at initialization (client/admin passwords)

pull/10/head
Chocobozzz 2016-04-19 22:29:36 +02:00
parent e7ea0979f8
commit bb1e6d0ce3
2 changed files with 5 additions and 5 deletions

View File

@ -58,6 +58,7 @@
"multer": "^1.1.0",
"node-ipc": "^7.0.0",
"openssl-wrapper": "^0.2.3",
"password-generator": "^2.0.2",
"request": "^2.57.0",
"request-replay": "^1.0.2",
"segfault-handler": "^1.0.0",

View File

@ -3,6 +3,7 @@
const async = require('async')
const config = require('config')
const mkdirp = require('mkdirp')
const passwordGenerator = require('password-generator')
const path = require('path')
const checker = require('./checker')
@ -56,8 +57,7 @@ function createOAuthClientIfNotExist (callback) {
logger.info('Creating a default OAuth Client.')
// TODO: generate password
const secret = 'megustalabanana'
const secret = passwordGenerator(32, false)
Users.createClient(secret, [ 'password' ], function (err, id) {
if (err) return callback(err)
@ -78,9 +78,8 @@ function createOAuthUserIfNotExist (callback) {
logger.info('Creating the administrator.')
// TODO: generate password
const username = 'admin'
const password = 'nomegustalabanana'
const username = 'root'
const password = passwordGenerator(8, true)
Users.createUser(username, password, function (err) {
if (err) return callback(err)