From 772f2a4004ecccd30996e209363f1cb850d44aea Mon Sep 17 00:00:00 2001 From: nikospapcom Date: Mon, 30 Sep 2024 14:07:23 +0300 Subject: [PATCH] chore(clerk-js): Allow single-character usernames in `` validation --- .changeset/cold-mayflies-happen.md | 5 +++++ .../clerk-js/src/ui/components/UserProfile/UsernameForm.tsx | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/cold-mayflies-happen.md diff --git a/.changeset/cold-mayflies-happen.md b/.changeset/cold-mayflies-happen.md new file mode 100644 index 00000000000..8984e4d2d88 --- /dev/null +++ b/.changeset/cold-mayflies-happen.md @@ -0,0 +1,5 @@ +--- +"@clerk/clerk-js": patch +--- + +Allow single-character usernames in `` validation \ No newline at end of file diff --git a/packages/clerk-js/src/ui/components/UserProfile/UsernameForm.tsx b/packages/clerk-js/src/ui/components/UserProfile/UsernameForm.tsx index eec9af457e5..ea8f191334c 100644 --- a/packages/clerk-js/src/ui/components/UserProfile/UsernameForm.tsx +++ b/packages/clerk-js/src/ui/components/UserProfile/UsernameForm.tsx @@ -27,7 +27,7 @@ export const UsernameForm = withCardStateProvider((props: UsernameFormProps) => const isUsernameRequired = userSettings.attributes.username.required; const canSubmit = - (isUsernameRequired ? usernameField.value.length > 1 : true) && user.username !== usernameField.value; + (isUsernameRequired ? usernameField.value.length > 0 : true) && user.username !== usernameField.value; const updatePassword = async () => { try {