Skip to content

Commit 07708bb

Browse files
author
defelmnq
committed
fix(setup): improve password validation flow on first user setup
1 parent 7f98fa3 commit 07708bb

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

site/src/pages/SetupPage/SetupPageView.tsx

+6-1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ export const Language = {
3030
usernameLabel: "Username",
3131
emailInvalid: "Please enter a valid email address.",
3232
emailRequired: "Please enter an email address.",
33+
passwordTooShort: "Password should be at least 6 characters.",
34+
passwordTooLong: "Password should be no more than 64 characters.",
3335
passwordRequired: "Please enter a password.",
3436
create: "Create account",
3537
welcomeMessage: <>Welcome to Coder</>,
@@ -54,7 +56,10 @@ const validationSchema = Yup.object({
5456
.trim()
5557
.email(Language.emailInvalid)
5658
.required(Language.emailRequired),
57-
password: Yup.string().required(Language.passwordRequired),
59+
password: Yup.string()
60+
.min(6, Language.passwordTooShort)
61+
.max(64, Language.passwordTooLong)
62+
.required(Language.passwordRequired),
5863
username: nameValidator(Language.usernameLabel),
5964
trial: Yup.bool(),
6065
trial_info: Yup.object().when("trial", {

0 commit comments

Comments
 (0)