Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

🔒 fix: add rate limit custom rules for password reset and email verification (#12808)

YuTengjingf25edcc02710
diff --git a/src/libs/better-auth/define-config.ts b/src/libs/better-auth/define-config.ts
index 96657e09c3f..45eb171744d 100644
--- a/src/libs/better-auth/define-config.ts
+++ b/src/libs/better-auth/define-config.ts
@@ -253,6 +253,12 @@ export function defineConfig(customOptions: CustomBetterAuthOptions) {
},
},
},
+ rateLimit: {
+ customRules: {
+ '/request-password-reset': { max: 3, window: 60 },
+ '/send-verification-email': { max: 3, window: 60 },
+ },
+ },
plugins: [
...customOptions.plugins,
emailWhitelist(),