[GH-ISSUE #1957] rate limit modelName can't have schema name #26305

Closed
opened 2026-04-17 16:48:31 -05:00 by GiteaMirror · 0 comments
Owner

Originally created by @ShahriarKh on GitHub (Mar 23, 2025).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/1957

rateLimit can only use tables created in public schema:

export const auth = betterAuth({
    rateLimit: {
        // ...other options
        storage: "database",
        modelName: "rateLimit",             // works
        modelName: "someSchema.rateLimit",  // doesn't work
    },
})

Using a custom schema shows this in response:

undefined is not an object (evaluating 'schema[model].fields')

I think this issue is similar: #1884

Database: Postgres 16
better-auth: 1.2.4

Originally created by @ShahriarKh on GitHub (Mar 23, 2025). Original GitHub issue: https://github.com/better-auth/better-auth/issues/1957 rateLimit can only use tables created in `public` schema: ```tsx export const auth = betterAuth({ rateLimit: { // ...other options storage: "database", modelName: "rateLimit", // works modelName: "someSchema.rateLimit", // doesn't work }, }) ``` Using a custom schema shows this in response: ``` undefined is not an object (evaluating 'schema[model].fields') ``` I think this issue is similar: #1884 Database: Postgres 16 better-auth: 1.2.4
GiteaMirror added the locked label 2026-04-17 16:48:31 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#26305