aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/users/index.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/controllers/api/users/index.ts')
-rw-r--r--server/controllers/api/users/index.ts6
1 files changed, 5 insertions, 1 deletions
diff --git a/server/controllers/api/users/index.ts b/server/controllers/api/users/index.ts
index d339c2a1c..869f31d84 100644
--- a/server/controllers/api/users/index.ts
+++ b/server/controllers/api/users/index.ts
@@ -176,6 +176,7 @@ export {
176 176
177async function createUser (req: express.Request, res: express.Response) { 177async function createUser (req: express.Request, res: express.Response) {
178 const body: UserCreate = req.body 178 const body: UserCreate = req.body
179
179 const userToCreate = new UserModel({ 180 const userToCreate = new UserModel({
180 username: body.username, 181 username: body.username,
181 password: body.password, 182 password: body.password,
@@ -194,7 +195,10 @@ async function createUser (req: express.Request, res: express.Response) {
194 userToCreate.password = await generateRandomString(20) 195 userToCreate.password = await generateRandomString(20)
195 } 196 }
196 197
197 const { user, account, videoChannel } = await createUserAccountAndChannelAndPlaylist({ userToCreate: userToCreate }) 198 const { user, account, videoChannel } = await createUserAccountAndChannelAndPlaylist({
199 userToCreate,
200 channelNames: { name: body.channelName, displayName: body.channelName }
201 })
198 202
199 auditLogger.create(getAuditIdFromRes(res), new UserAuditView(user.toFormattedJSON())) 203 auditLogger.create(getAuditIdFromRes(res), new UserAuditView(user.toFormattedJSON()))
200 logger.info('User %s with its channel and account created.', body.username) 204 logger.info('User %s with its channel and account created.', body.username)