[PR #6398] [MERGED] fix: fields type for rate limit options #6639

Closed
opened 2026-03-13 13:06:22 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/6398
Author: @ceolinwill
Created: 11/28/2025
Status: Merged
Merged: 11/29/2025
Merged by: @Bekacru

Base: canaryHead: fix/rate-limit-type


📝 Commits (1)

  • 275bbd5 fix: fields type for rate limit options

📊 Changes

1 file changed (+1 additions, -1 deletions)

View changed files

📝 packages/core/src/types/init-options.ts (+1 -1)

📄 Description

There's a bug where we can't change a single field's name for rateLimit because it only accepts a full record, not partial ones. So, this fails right now:

fields: {
  lastRequest: "last_request",
},

Summary by cubic

Fixes rateLimit options to accept partial field overrides, so you can rename a single field without providing all fields. Updated fields type to Partial<Record<keyof RateLimit, string>>.

Written for commit 275bbd54bc. Summary will update automatically on new commits.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/6398 **Author:** [@ceolinwill](https://github.com/ceolinwill) **Created:** 11/28/2025 **Status:** ✅ Merged **Merged:** 11/29/2025 **Merged by:** [@Bekacru](https://github.com/Bekacru) **Base:** `canary` ← **Head:** `fix/rate-limit-type` --- ### 📝 Commits (1) - [`275bbd5`](https://github.com/better-auth/better-auth/commit/275bbd54bc2d115105b5f858f89c1a1c4720e45e) fix: fields type for rate limit options ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `packages/core/src/types/init-options.ts` (+1 -1) </details> ### 📄 Description There's a bug where we can't change a single field's name for `rateLimit` because it only accepts a full record, not partial ones. So, this fails right now: ```ts fields: { lastRequest: "last_request", }, ``` <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Fixes rateLimit options to accept partial field overrides, so you can rename a single field without providing all fields. Updated fields type to Partial<Record<keyof RateLimit, string>>. <sup>Written for commit 275bbd54bc2d115105b5f858f89c1a1c4720e45e. Summary will update automatically on new commits.</sup> <!-- End of auto-generated description by cubic. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-03-13 13:06:22 -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#6639