Passwords entered which don't pass validation get 500 error #692

Closed
opened 2026-03-13 08:00:34 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @t3duk on GitHub (Feb 17, 2025).

Is this suited for github?

  • Yes, this is suited for github

To Reproduce

Use a function such as authClient.twoFactor.disable and pass the password as a string under 8 characters.

Current vs. Expected behavior

Currently, the server responds with an internal server error stating that the password does not match validation.
It should return an error message and 401 code to suggest the password is incorrect.
Passwords 8+ characters which are entered do experience the expected behaviour, just passwords <8 character do not.

What version of Better Auth are you using?

1.1.8

Provide environment information

MacBook Pro M2 Max on Arc

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

Client

Auth config (if applicable)


Additional context

Image

Originally created by @t3duk on GitHub (Feb 17, 2025). ### Is this suited for github? - [x] Yes, this is suited for github ### To Reproduce Use a function such as `authClient.twoFactor.disable` and pass the password as a string under 8 characters. ### Current vs. Expected behavior Currently, the server responds with an internal server error stating that the password does not match validation. It should return an error message and 401 code to suggest the password is incorrect. Passwords 8+ characters which are entered **do** experience the expected behaviour, just passwords <8 character **do not**. ### What version of Better Auth are you using? 1.1.8 ### Provide environment information ```bash MacBook Pro M2 Max on Arc ``` ### Which area(s) are affected? (Select all that apply) Client ### Auth config (if applicable) ```typescript ``` ### Additional context ![Image](https://github.com/user-attachments/assets/9ff85921-57e1-4771-ad54-66ea4ac1ece5)
GiteaMirror added the stalebug labels 2026-03-13 08:00:34 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Jun 11, 2025):

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

Issue Summary:

  • You reported a server error when using authClient.twoFactor.disable with a password under 8 characters.
  • The server returns a 500 internal error instead of the expected 401 error.
  • This issue occurs in version 1.1.8 on a MacBook Pro M2 Max.
  • No further comments or developments have been made on this issue.

Next Steps:

  • Please let me know if this issue is still relevant to the latest version of the better-auth repository by commenting here.
  • If there is no response, the issue will be automatically closed in 7 days.

Thank you for your understanding and contribution!

@dosubot[bot] commented on GitHub (Jun 11, 2025): Hi, @t3duk. I'm [Dosu](https://dosu.dev), and I'm helping the better-auth team manage their backlog. I'm marking this issue as stale. **Issue Summary:** - You reported a server error when using `authClient.twoFactor.disable` with a password under 8 characters. - The server returns a 500 internal error instead of the expected 401 error. - This issue occurs in version 1.1.8 on a MacBook Pro M2 Max. - No further comments or developments have been made on this issue. **Next Steps:** - Please let me know if this issue is still relevant to the latest version of the better-auth repository by commenting here. - If there is no response, the issue will be automatically closed in 7 days. Thank you for your understanding and contribution!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#692