Refactor
This commit is contained in:
10
src/remote/activitypub/renderer/key.ts
Normal file
10
src/remote/activitypub/renderer/key.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import config from '../../../conf';
|
||||
import { extractPublic } from '../../../crypto_key';
|
||||
import { ILocalUser } from '../../../models/user';
|
||||
|
||||
export default (user: ILocalUser) => ({
|
||||
id: `${config.url}/@${user.username}/publickey`,
|
||||
type: 'Key',
|
||||
owner: `${config.url}/@${user.username}`,
|
||||
publicKeyPem: extractPublic(user.account.keypair)
|
||||
});
|
Reference in New Issue
Block a user