fix: display friendly error message for password validation on signup (#5563)

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Brian Fromm
2025-11-19 09:42:50 -07:00
committed by GitHub
parent a3b5584505
commit 6d5aa355e4
3 changed files with 13 additions and 1 deletions

View File

@@ -112,6 +112,13 @@ const submit = async (event: Event) => {
error.value = t("login.usernameTaken");
} else if (e.status === 403) {
error.value = t("login.wrongCredentials");
} else if (e.status === 400) {
const match = e.message.match(/minimum length is (\d+)/);
if (match) {
error.value = t("login.passwordTooShort", { min: match[1] });
} else {
error.value = e.message;
}
} else {
$showError(e);
}