From a0a612618e7e9703fa268c16fe23d64f127c5279 Mon Sep 17 00:00:00 2001 From: miloschwartz Date: Wed, 10 Sep 2025 14:20:25 -0700 Subject: [PATCH] fixed email undefined error on request email code --- server/routers/external.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/routers/external.ts b/server/routers/external.ts index e421a3e2..b66ebf97 100644 --- a/server/routers/external.ts +++ b/server/routers/external.ts @@ -956,7 +956,7 @@ authRouter.post( windowMs: 15 * 60 * 1000, max: 15, keyGenerator: (req) => - `requestEmailVerificationCode:${req.body.email || ipKeyGenerator(req.ip || "")}`, + `requestEmailVerificationCode:${req.user?.email || ipKeyGenerator(req.ip || "")}`, handler: (req, res, next) => { const message = `You can only request an email verification code ${15} times every ${15} minutes. Please try again later.`; return next(createHttpError(HttpCode.TOO_MANY_REQUESTS, message));