diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2019-04-08 00:46:01 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2019-04-08 00:46:01 +0900 |
| commit | b6889e9ac6c5b3c3b51b3bdf7ec1fc20b4a07da8 (patch) | |
| tree | a1412fc525a593b9e169f23b764eb138dc3098d0 /src/remote | |
| parent | Fix bug (diff) | |
| download | sharkey-b6889e9ac6c5b3c3b51b3bdf7ec1fc20b4a07da8.tar.gz sharkey-b6889e9ac6c5b3c3b51b3bdf7ec1fc20b4a07da8.tar.bz2 sharkey-b6889e9ac6c5b3c3b51b3bdf7ec1fc20b4a07da8.zip | |
Fix bug
Diffstat (limited to 'src/remote')
| -rw-r--r-- | src/remote/activitypub/models/person.ts | 19 |
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 |