aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/user.ts
diff options
context:
space:
mode:
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}