[PR #5115] [MERGED] fix: improve username transformation logic #31388

Closed
opened 2026-04-17 22:15:25 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/5115
Author: @ping-maxwell
Created: 10/6/2025
Status: Merged
Merged: 10/6/2025
Merged by: @ping-maxwell

Base: canaryHead: fix/username-transformation-logic


📝 Commits (2)

  • bd962c7 fix: improve username transformation logic
  • 95c0aac Merge branch 'canary' into fix/username-transformation-logic

📊 Changes

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

View changed files

📝 packages/better-auth/src/plugins/username/schema.ts (+2 -2)

📄 Description

Will prevent any bugs we may encounter in the future if value is not null or a string type.


Summary by cubic

Run username and displayUsername transforms only for string inputs. Non-strings pass through unchanged, preventing errors from normalizing invalid types.


🔄 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/5115 **Author:** [@ping-maxwell](https://github.com/ping-maxwell) **Created:** 10/6/2025 **Status:** ✅ Merged **Merged:** 10/6/2025 **Merged by:** [@ping-maxwell](https://github.com/ping-maxwell) **Base:** `canary` ← **Head:** `fix/username-transformation-logic` --- ### 📝 Commits (2) - [`bd962c7`](https://github.com/better-auth/better-auth/commit/bd962c718fe59bdf37d0b746da0ca1da2c4f4f35) fix: improve username transformation logic - [`95c0aac`](https://github.com/better-auth/better-auth/commit/95c0aac037d2b4e8676d2c0e60778d71d78be0d7) Merge branch 'canary' into fix/username-transformation-logic ### 📊 Changes **1 file changed** (+2 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/plugins/username/schema.ts` (+2 -2) </details> ### 📄 Description Will prevent any bugs we may encounter in the future if `value` is not `null` or a string type. <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Run username and displayUsername transforms only for string inputs. Non-strings pass through unchanged, preventing errors from normalizing invalid types. <!-- 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-04-17 22:15:25 -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#31388