X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fcontrollers%2Fapi%2Fusers%2Findex.ts;h=869f31d848ce739175d5288d3a02d1aaa52fabd0;hb=3d215dc5f978b58b8a6d0154c3feae27f13f1600;hp=d339c2a1c0abf498c36d48b5bdf60f265471c477;hpb=4abe9c593aab52391e4cb9e3a578ed46a479934d;p=github%2FChocobozzz%2FPeerTube.git 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 { async function createUser (req: express.Request, res: express.Response) { const body: UserCreate = req.body + const userToCreate = new UserModel({ username: body.username, password: body.password, @@ -194,7 +195,10 @@ async function createUser (req: express.Request, res: express.Response) { userToCreate.password = await generateRandomString(20) } - const { user, account, videoChannel } = await createUserAccountAndChannelAndPlaylist({ userToCreate: userToCreate }) + const { user, account, videoChannel } = await createUserAccountAndChannelAndPlaylist({ + userToCreate, + channelNames: { name: body.channelName, displayName: body.channelName } + }) auditLogger.create(getAuditIdFromRes(res), new UserAuditView(user.toFormattedJSON())) logger.info('User %s with its channel and account created.', body.username)