Skip to content

Commit 5048619

Browse files
committed
fix: await user creation and set userKey if provided
1 parent a491a1c commit 5048619

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/server.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,10 @@ class CoCreateUser {
4141
if (data.user) {
4242
data.user.method = "object.create";
4343
data.user.host = data.host;
44-
await this.crud.send(data.user);
44+
let createdUser = await this.crud.send(data.user);
45+
if (data.userKey && createdUser.object[0] && createdUser.object[0]._id) {
46+
data.userKey.object.key = createdUser.object[0]._id;
47+
}
4548
}
4649

4750
if (data.userKey) {

0 commit comments

Comments
 (0)