diff --git a/packages/backend/src/remote/activitypub/models/person.ts b/packages/backend/src/remote/activitypub/models/person.ts index 3cf50eda9..0136aeea3 100644 --- a/packages/backend/src/remote/activitypub/models/person.ts +++ b/packages/backend/src/remote/activitypub/models/person.ts @@ -129,14 +129,12 @@ export async function fetchPerson(uri: string, resolver: Resolver): Promise { - if (typeof uri !== 'string') throw new Error('uri is not string'); - - if (uri.startsWith(config.url)) { +export async function createPerson(value: string | IObject, resolver: Resolver): Promise { + if (getApId(value).startsWith(config.url)) { throw new StatusError('cannot resolve local user', 400, 'cannot resolve local user'); } - const object = await resolver.resolve(uri) as any; + const object = await resolver.resolve(value) as any; const person = validateActor(object); @@ -272,7 +270,7 @@ export async function createPerson(uri: string, resolver: Resolver): Promise