1
0
mirror of https://github.com/hotomoe/hotomoe synced 2024-11-25 15:46:17 +09:00
This commit is contained in:
syuilo 2019-04-08 00:46:01 +09:00
parent dc82203e9b
commit b6889e9ac6
No known key found for this signature in database
GPG Key ID: BDC4C49D06AB9D69

View File

@ -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