[PR #3680] [MERGED] fix(api-key): is-username-available endpoint should also validate usernames #4953

Closed
opened 2026-03-13 12:05:24 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/3680
Author: @ping-maxwell
Created: 7/28/2025
Status: Merged
Merged: 8/1/2025
Merged by: @Bekacru

Base: mainHead: fix/api-key/username-availability-should-validate-it


📝 Commits (3)

  • b30a670 fix(api-key): is-username-available endpoint should also validate usernames
  • 9193d58 chore: changeset
  • 8cfca10 chore: changeset update

📊 Changes

2 files changed (+29 additions, -0 deletions)

View changed files

.changeset/wild-pianos-join.md (+5 -0)
📝 packages/better-auth/src/plugins/username/index.ts (+24 -0)

📄 Description

Adds username validation in the isUsernameAvailable endpoint - such as username length & custom validators


Summary by cubic

The isUsernameAvailable endpoint now checks if usernames meet length and custom validation rules before confirming availability.

  • Bug Fixes
  • Added checks for minimum and maximum username length.
  • Applied custom username validators to ensure valid input.

🔄 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/3680 **Author:** [@ping-maxwell](https://github.com/ping-maxwell) **Created:** 7/28/2025 **Status:** ✅ Merged **Merged:** 8/1/2025 **Merged by:** [@Bekacru](https://github.com/Bekacru) **Base:** `main` ← **Head:** `fix/api-key/username-availability-should-validate-it` --- ### 📝 Commits (3) - [`b30a670`](https://github.com/better-auth/better-auth/commit/b30a6706bc777b8492c8352843f9f53519b21468) fix(api-key): is-username-available endpoint should also validate usernames - [`9193d58`](https://github.com/better-auth/better-auth/commit/9193d58bb696268f67436429d6e66ade0c6c2bf1) chore: changeset - [`8cfca10`](https://github.com/better-auth/better-auth/commit/8cfca105b804816b8bbc5d9d79590737fc9923d9) chore: changeset update ### 📊 Changes **2 files changed** (+29 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `.changeset/wild-pianos-join.md` (+5 -0) 📝 `packages/better-auth/src/plugins/username/index.ts` (+24 -0) </details> ### 📄 Description Adds username validation in the `isUsernameAvailable` endpoint - such as username length & custom validators <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic The isUsernameAvailable endpoint now checks if usernames meet length and custom validation rules before confirming availability. - **Bug Fixes** - Added checks for minimum and maximum username length. - Applied custom username validators to ensure valid input. <!-- 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 12:05:24 -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#4953