mirror of
https://github.com/LukeHagar/better-auth.git
synced 2025-12-06 04:19:20 +00:00
fix: improve username transformation logic (#5115)
This commit is contained in:
@@ -15,7 +15,7 @@ export const getSchema = (normalizer: {
|
||||
returned: true,
|
||||
transform: {
|
||||
input(value) {
|
||||
return value == null
|
||||
return typeof value !== "string"
|
||||
? value
|
||||
: normalizer.username(value as string);
|
||||
},
|
||||
@@ -26,7 +26,7 @@ export const getSchema = (normalizer: {
|
||||
required: false,
|
||||
transform: {
|
||||
input(value) {
|
||||
return value == null
|
||||
return typeof value !== "string"
|
||||
? value
|
||||
: normalizer.displayUsername(value as string);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user