Missing details/tryAgain property from RATE_LIMITED error from verifyApiKey #1344

Closed
opened 2026-03-13 08:34:05 -05:00 by GiteaMirror · 3 comments
Owner

Originally created by @opswiz on GitHub (Jun 11, 2025).

Is this suited for github?

  • Yes, this is suited for github

To Reproduce

  • Update from v1.2.8 to v1.2.9
  • The RATE_LIMITED error from auth.api.verifyApiKey used to have details object with tryAgainIn value
  • After update its missing

Current vs. Expected behavior

After upgrading from v1.2.8 -> v1.2.9. The details.tryAgainIn property is missing from RATE_LIMITED error returned by the verifyApiKey method.

Image

Is this intentional? I used this to forward the value to the client if there is a rate limit error and was quite helpful

What version of Better Auth are you using?

1.2.9

Provide environment information

- MacOs
- Nextjs 15

Which area(s) are affected? (Select all that apply)

Package

Auth config (if applicable)

import { betterAuth } from "better-auth"
export const auth = betterAuth({
  emailAndPassword: {  
    enabled: true
  },
});

Additional context

No response

Originally created by @opswiz on GitHub (Jun 11, 2025). ### Is this suited for github? - [x] Yes, this is suited for github ### To Reproduce - Update from v1.2.8 to v1.2.9 - The `RATE_LIMITED` error from `auth.api.verifyApiKey` used to have details object with tryAgainIn value - After update its missing ### Current vs. Expected behavior After upgrading from v1.2.8 -> v1.2.9. The `details.tryAgainIn` property is missing from `RATE_LIMITED` error returned by the `verifyApiKey` method. <img width="944" alt="Image" src="https://github.com/user-attachments/assets/df86b180-b9d8-435a-9c53-df1f04e9999f" /> Is this intentional? I used this to forward the value to the client if there is a rate limit error and was quite helpful ### What version of Better Auth are you using? 1.2.9 ### Provide environment information ```bash - MacOs - Nextjs 15 ``` ### Which area(s) are affected? (Select all that apply) Package ### Auth config (if applicable) ```typescript import { betterAuth } from "better-auth" export const auth = betterAuth({ emailAndPassword: { enabled: true }, }); ``` ### Additional context _No response_
GiteaMirror added the nextjsbug labels 2026-03-13 08:34:05 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Sep 10, 2025):

Hi, @opswiz. I'm Dosu, and I'm helping the better-auth team manage their backlog and am marking this issue as stale.

Issue Summary:

  • You reported that after upgrading from v1.2.8 to v1.2.9, the RATE_LIMITED error from auth.api.verifyApiKey no longer includes the details.tryAgainIn property.
  • This missing property affects your retry timing logic.
  • You asked if the removal of this property was intentional.
  • There have been no comments or responses on this issue so far.

Next Steps:

  • Please let me know if this issue is still relevant with the latest version of better-auth by commenting here.
  • If I don’t hear back within 7 days, I will automatically close this issue.

Thanks for your understanding and contribution!

@dosubot[bot] commented on GitHub (Sep 10, 2025): Hi, @opswiz. I'm [Dosu](https://dosu.dev), and I'm helping the better-auth team manage their backlog and am marking this issue as stale. **Issue Summary:** - You reported that after upgrading from v1.2.8 to v1.2.9, the `RATE_LIMITED` error from `auth.api.verifyApiKey` no longer includes the `details.tryAgainIn` property. - This missing property affects your retry timing logic. - You asked if the removal of this property was intentional. - There have been no comments or responses on this issue so far. **Next Steps:** - Please let me know if this issue is still relevant with the latest version of better-auth by commenting here. - If I don’t hear back within 7 days, I will automatically close this issue. Thanks for your understanding and contribution!
Author
Owner

@opswiz commented on GitHub (Sep 10, 2025):

Yes this issue still exists and relevant. @dosubot

@opswiz commented on GitHub (Sep 10, 2025): Yes this issue still exists and relevant. @dosubot
Author
Owner

@ping-maxwell commented on GitHub (Oct 2, 2025):

We don't support inferring errors yet, which is why types are not appearing. But the value should be there, you can just type-cast it until we support it.

@ping-maxwell commented on GitHub (Oct 2, 2025): We don't support inferring errors yet, which is why types are not appearing. But the value should be there, you can just type-cast it until we support it.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#1344