Skip to content

A self-hostable bookmark-everything app (links, notes and images) with AI-based automatic tagging and full text search

fix: ratelimit bookmark creation API

Mohamed Bassem6e5c2ef08ea2
diff --git a/packages/trpc/routers/bookmarks.ts b/packages/trpc/routers/bookmarks.ts
index 89812ec9..680bc31f 100644
--- a/packages/trpc/routers/bookmarks.ts
+++ b/packages/trpc/routers/bookmarks.ts
@@ -142,6 +142,13 @@ async function shouldUseLowPriorityQueues(
export const bookmarksAppRouter = router({
createBookmark: authedProcedure
+ .use(
+ createRateLimitMiddleware({
+ name: "bookmarks.createBookmark",
+ windowMs: 60 * 1000,
+ maxRequests: 30,
+ }),
+ )
.input(zNewBookmarkRequestSchema)
.output(
zBookmarkSchema.merge(