From 17ce804ffaaafb1b1efb61174217a1da275feda8 Mon Sep 17 00:00:00 2001 From: Daniel Holmgren Date: Fri, 15 Sep 2023 18:11:48 -0500 Subject: [PATCH] Tweak createSession rate limit key (#1614) tweak create session rl key --- packages/pds/src/api/com/atproto/server/createSession.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/pds/src/api/com/atproto/server/createSession.ts b/packages/pds/src/api/com/atproto/server/createSession.ts index aee0063d86c..3769cda08a6 100644 --- a/packages/pds/src/api/com/atproto/server/createSession.ts +++ b/packages/pds/src/api/com/atproto/server/createSession.ts @@ -11,12 +11,12 @@ export default function (server: Server, ctx: AppContext) { { durationMs: DAY, points: 300, - calcKey: ({ input }) => input.body.identifier, + calcKey: ({ input, req }) => `${input.body.identifier}-${req.ip}`, }, { durationMs: 5 * MINUTE, points: 30, - calcKey: ({ input }) => input.body.identifier, + calcKey: ({ input, req }) => `${input.body.identifier}-${req.ip}`, }, ], handler: async ({ input }) => {