mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-12-01 14:27:33 -07:00
4744276e15
* Sign ActivityPub GET * Fix v12, v12.48.0 UI bug
17 lines
474 B
TypeScript
17 lines
474 B
TypeScript
import { createSystemUser } from './create-system-user';
|
|
import { ILocalUser } from '../models/entities/user';
|
|
import { Users } from '../models';
|
|
|
|
const ACTOR_USERNAME = 'instance.actor' as const;
|
|
|
|
export async function getInstanceActor(): Promise<ILocalUser> {
|
|
const user = await Users.findOne({
|
|
host: null,
|
|
username: ACTOR_USERNAME
|
|
});
|
|
|
|
if (user) return user as ILocalUser;
|
|
|
|
const created = await createSystemUser(ACTOR_USERNAME);
|
|
return created as ILocalUser;
|
|
}
|