- return db.User.create(userData, createOptions).then(createdUser => {
- logger.info('Username: ' + username)
- logger.info('User password: ' + password)
-
- logger.info('Creating Application table.')
- return db.Application.create({ migrationVersion: LAST_MIGRATION_VERSION })
- })
- })
+ // Our password is weak so do not validate it
+ validatePassword = false
+ } else {
+ password = passwordGenerator(8, true)
+ }
+
+ const userData = {
+ username,
+ email,
+ password,
+ role,
+ videoQuota: -1
+ }
+ const user = db.User.build(userData)
+
+ await createUserAuthorAndChannel(user, validatePassword)
+ logger.info('Username: ' + username)
+ logger.info('User password: ' + password)
+
+ logger.info('Creating Application table.')
+ await db.Application.create({ migrationVersion: LAST_MIGRATION_VERSION })