aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/user.ts
diff options
context:
space:
mode:
authorbuoyantair <buoyantair@protonmail.com>2018-11-20 12:28:13 +0530
committerbuoyantair <buoyantair@protonmail.com>2018-11-20 12:28:13 +0530
commitbc22d60899e14631cba0fb6450f4e85fc9528293 (patch)
tree285fa55033bc065df803adc2e4e3142fdfdd7309 /server/lib/user.ts
parentb9f234371bfaf0d9cfa81e02fcea92cac1f9ae13 (diff)
parentd216b5387fb774d1355df3ace002f7be469bd450 (diff)
downloadPeerTube-bc22d60899e14631cba0fb6450f4e85fc9528293.tar.gz
PeerTube-bc22d60899e14631cba0fb6450f4e85fc9528293.tar.zst
PeerTube-bc22d60899e14631cba0fb6450f4e85fc9528293.zip
Merge branch 'develop' of https://github.com/Chocobozzz/PeerTube into move-utils-to-shared
Diffstat (limited to 'server/lib/user.ts')
-rw-r--r--server/lib/user.ts11
1 files changed, 8 insertions, 3 deletions
diff --git a/server/lib/user.ts b/server/lib/user.ts
index db29469eb..29d6d087d 100644
--- a/server/lib/user.ts
+++ b/server/lib/user.ts
@@ -18,7 +18,7 @@ async function createUserAccountAndChannel (userToCreate: UserModel, validateUse
18 } 18 }
19 19
20 const userCreated = await userToCreate.save(userOptions) 20 const userCreated = await userToCreate.save(userOptions)
21 const accountCreated = await createLocalAccountWithoutKeys(userToCreate.username, userToCreate.id, null, t) 21 const accountCreated = await createLocalAccountWithoutKeys(userCreated.username, userCreated.id, null, t)
22 userCreated.Account = accountCreated 22 userCreated.Account = accountCreated
23 23
24 let channelName = userCreated.username + '_channel' 24 let channelName = userCreated.username + '_channel'
@@ -37,8 +37,13 @@ async function createUserAccountAndChannel (userToCreate: UserModel, validateUse
37 return { user: userCreated, account: accountCreated, videoChannel } 37 return { user: userCreated, account: accountCreated, videoChannel }
38 }) 38 })
39 39
40 account.Actor = await setAsyncActorKeys(account.Actor) 40 const [ accountKeys, channelKeys ] = await Promise.all([
41 videoChannel.Actor = await setAsyncActorKeys(videoChannel.Actor) 41 setAsyncActorKeys(account.Actor),
42 setAsyncActorKeys(videoChannel.Actor)
43 ])
44
45 account.Actor = accountKeys
46 videoChannel.Actor = channelKeys
42 47
43 return { user, account, videoChannel } as { user: UserModel, account: AccountModel, videoChannel: VideoChannelModel } 48 return { user, account, videoChannel } as { user: UserModel, account: AccountModel, videoChannel: VideoChannelModel }
44} 49}