Skip to content

Commit

Permalink
Restricted Following to Owners
Browse files Browse the repository at this point in the history
  • Loading branch information
allouis committed Jul 10, 2024
1 parent e40b448 commit 342e4b3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ async function postToArticle(ctx: RequestContext<ContextData>, post: any) {
export async function followAction(
ctx: Context<{ Variables: HonoContextVariables }>,
) {
if (ctx.get('role') !== 'Owner') {
return new Response(null, {
status: 403
});
}
const handle = ctx.req.param('handle');
const actorToFollow = await lookupObject(handle);
if (!isActor(actorToFollow)) {
Expand Down

0 comments on commit 342e4b3

Please sign in to comment.