Something went wrong. Try again.
Schedule posts and reposts to Bluesky (and other PDSes) with Cloudflare workers. skyscheduler.work
scheduling social-media cloudflare bsky service cloudflare-workers bsky-tool bluesky
Something went wrong. Try again.
515 B · 15 lines
TypeScript
at main
12345678910111213141516import { every } from "hono/combine";import type { BaseContext, NextMiddleware } from "../types";import { authMiddleware } from "./auth";
// This requires that the user is an admin, it must pipe through// the auth middleware first.async function adminOnlyMiddleware(c: BaseContext, next: NextMiddleware) { if (c.get("isAdmin")) { await next(); return; } return c.json({ ok: false, msg: "Unauthorized" }, 401);}
export const authAdminOnlyMiddleware = every(authMiddleware, adminOnlyMiddleware);