Skip to content

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

fix: add ratelimiting for the changePassword endpoint (#2723)

Mohamed Bassem8b51bff2595a
diff --git a/packages/trpc/routers/users.ts b/packages/trpc/routers/users.ts
index b242ac6d..0610305e 100644
--- a/packages/trpc/routers/users.ts
+++ b/packages/trpc/routers/users.ts
@@ -101,6 +101,13 @@ export const usersAppRouter = router({
};
}),
changePassword: authedProcedure
+ .use(
+ createRateLimitMiddleware({
+ name: "users.changePassword",
+ windowMs: 15 * 60 * 1000,
+ maxRequests: 5,
+ }),
+ )
.input(
z.object({
currentPassword: z.string(),