Files
better-auth/packages
DannyandGitHub 8fbe8f03a5 chore: model name needs to be default name (#3538)
I was mistaken a [previous fix](https://github.com/better-auth/better-auth/commit/452069aed976f3f06bd3f94d0d51cc74449ad9e3), it just moved the error.

This value should be the default model name to match [transformInput](https://github.com/better-auth/better-auth/blob/76c90f2e59b99c6d84b30ca0d3bc82cc0644ef2f/packages/better-auth/src/adapters/create-adapter/index.ts#L324) schema lookup.

The schema looks like this
```
{
   ...
        rateLimit: {
          modelName: 'rateLimits',
          fields: {
            key: [Object],
            count: [Object],
            lastRequest: [Object],
            id: [Object]
          }
        }
      }
```

Matching on the default name returns the correct schema.

This test is now passing locally a different rateLimiter model. 

```
            it ( "should hit rate limit on forth login attempt within 10s", async () => {

                for ( let i = 0; i < 3; i++ ) {

                    const response = await request( testApp )
                        .post( usernameSignInPath )
                        .send( { username: testUsername, password: testPassword } );

                    expect( response.statusCode ).toEqual( 200 );

                }

                const res = await request( testApp )
                    .post( usernameSignInPath )
                    .send( { username: testUsername, password: testPassword } );

                expect( res.statusCode ).toEqual( 429 );
                expect( res.headers ).toHaveProperty( "x-retry-after" );

            } );
```
2025-07-21 23:09:03 -07:00
..
2025-07-20 22:19:21 -07:00
2025-07-20 22:19:21 -07:00
2025-07-20 22:19:21 -07:00
2025-07-20 22:19:21 -07:00