summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2019-04-08 00:46:01 +0900
committersyuilo <syuilotan@yahoo.co.jp>2019-04-08 00:46:01 +0900
commitb6889e9ac6c5b3c3b51b3bdf7ec1fc20b4a07da8 (patch)
treea1412fc525a593b9e169f23b764eb138dc3098d0 /src
parentFix bug (diff)
downloadsharkey-b6889e9ac6c5b3c3b51b3bdf7ec1fc20b4a07da8.tar.gz
sharkey-b6889e9ac6c5b3c3b51b3bdf7ec1fc20b4a07da8.tar.bz2
sharkey-b6889e9ac6c5b3c3b51b3bdf7ec1fc20b4a07da8.zip
Fix bug
Diffstat (limited to 'src')
-rw-r--r--src/remote/activitypub/models/person.ts19
1 files changed, 7 insertions, 12 deletions
diff --git a/src/remote/activitypub/models/person.ts b/src/remote/activitypub/models/person.ts
index 51a9efa10b..fbc329e860 100644
--- a/src/remote/activitypub/models/person.ts
+++ b/src/remote/activitypub/models/person.ts
@@ -159,18 +159,6 @@ export async function createPerson(uri: string, resolver?: Resolver): Promise<Us
isBot,
isCat: (person as any).isCat === true
} as Partial<User>) as IRemoteUser;
-
- await UserPublickeys.save({
- id: genId(),
- userId: user.id,
- keyId: person.publicKey.id,
- keyPem: person.publicKey.publicKeyPem
- } as UserPublickey);
-
- await UserServiceLinkings.save({
- id: genId(),
- userId: user.id,
- } as UserServiceLinking);
} catch (e) {
// duplicate key error
if (isDuplicateKeyValueError(e)) {
@@ -181,6 +169,13 @@ export async function createPerson(uri: string, resolver?: Resolver): Promise<Us
throw e;
}
+ await UserPublickeys.save({
+ id: genId(),
+ userId: user.id,
+ keyId: person.publicKey.id,
+ keyPem: person.publicKey.publicKeyPem
+ } as UserPublickey);
+
await UserServiceLinkings.save({
id: genId(),
userId: user.id