Rate limit bugs #165

Closed
opened 2026-03-13 07:35:58 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @Aziz-AXG on GitHub (Nov 2, 2024).

Trying to add rate Limit to the auth and found some bugs

1- trying to add custom Rules to Phone Number plugin and it don't work but the main rate Limit work fine

rateLimit: {
    enabled: true,
    window: 60,
    max: 30,
    customRules: {
      "/phone-number/send-otp": {
        window: 60,
        max: 1,
      },
    },
  },

2- if i add database storage all rate Limit don't work without any error log

  rateLimit: {
    enabled: true,
    storage: "database",
    tableName: "rateLimit",
    window: 60,
    max: 30,
    customRules: {
      "/phone-number/send-otp": {
        window: 60,
        max: 1,
      },
    },
  },

even after make sure the rate Limit schema is linked

database: drizzleAdapter(db, {
    provider: "sqlite",
    schema: {
      ...schema,
      user: schema.User,
      rateLimit: schema.rateLimit,
    },
  }),

and the rateLimit table in db Is empty
Desktop: win 11, mode.js 22.6.0

Originally created by @Aziz-AXG on GitHub (Nov 2, 2024). Trying to add rate Limit to the auth and found some bugs 1- trying to add custom Rules to Phone Number plugin and it don't work but the main rate Limit work fine ``` rateLimit: { enabled: true, window: 60, max: 30, customRules: { "/phone-number/send-otp": { window: 60, max: 1, }, }, }, ``` 2- if i add database storage all rate Limit don't work without any error log ``` rateLimit: { enabled: true, storage: "database", tableName: "rateLimit", window: 60, max: 30, customRules: { "/phone-number/send-otp": { window: 60, max: 1, }, }, }, ``` even after make sure the rate Limit schema is linked ``` database: drizzleAdapter(db, { provider: "sqlite", schema: { ...schema, user: schema.User, rateLimit: schema.rateLimit, }, }), ``` and the rateLimit table in db Is empty Desktop: win 11, mode.js 22.6.0
Author
Owner

@jstri commented on GitHub (Nov 26, 2024):

Rate limit customStorage configuration is either not implemented (at least I couldn't find it) or not being respected.

@jstri commented on GitHub (Nov 26, 2024): Rate limit `customStorage` configuration is either not implemented (at least I couldn't find it) or not being respected.
Author
Owner

@Bekacru commented on GitHub (Dec 3, 2024):

hey guys both issues should be fixed on 1.0.10! feel free to re-open if not

@Bekacru commented on GitHub (Dec 3, 2024): hey guys both issues should be fixed on 1.0.10! feel free to re-open if not
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#165