pass access token through API to enforce rank

This commit is contained in:
Hazelnoot 2025-06-21 12:40:37 -04:00
parent fae87e03c0
commit 186c615e3f
166 changed files with 473 additions and 380 deletions

View file

@ -78,7 +78,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
private instanceEntityService: InstanceEntityService,
) {
super(meta, paramDef, async (ps, me) => {
super(meta, paramDef, async (ps, me, token) => {
const [topSubInstances, topPubInstances, allSubCount, allPubCount] = await Promise.all([
this.instancesRepository.find({
where: {
@ -114,9 +114,9 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
const gotPubCount = topPubInstances.map(x => x.followingCount).reduce((a, b) => a + b, 0);
return await awaitAll({
topSubInstances: this.instanceEntityService.packMany(topSubInstances, me),
topSubInstances: this.instanceEntityService.packMany(topSubInstances, me, token),
otherFollowersCount: Math.max(0, allSubCount - gotSubCount),
topPubInstances: this.instanceEntityService.packMany(topPubInstances, me),
topPubInstances: this.instanceEntityService.packMany(topPubInstances, me, token),
otherFollowingCount: Math.max(0, allPubCount - gotPubCount),
});
});