improvement: trim and substring keys and default to realIp

This commit is contained in:
Scott Wilson
2025-06-04 20:00:53 -07:00
parent 9c149cb4bf
commit 135f425fcf
4 changed files with 5 additions and 4 deletions
@@ -82,7 +82,8 @@ export const registerInviteOrgRouter = async (server: FastifyZodProvider) => {
url: "/signup-resend",
config: {
rateLimit: smtpRateLimit({
keyGenerator: (req) => (req.body as { membershipId: string }).membershipId
keyGenerator: (req) =>
(req.body as { membershipId?: string })?.membershipId?.trim().substring(0, 100) ?? req.realIp
})
},
method: "POST",