Skip to content

Commit a6ee1cc

Browse files
committed
fix(password): display only if password is set
1 parent 0efd24f commit a6ee1cc

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

site/src/pages/CreateUserPage/CreateUserForm.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ export const CreateUserForm: FC<
205205
helperText:
206206
(form.values.login_type !== "password" &&
207207
"No password required for this login type") ||
208-
(!passwordIsValid && "password is not strong."),
208+
(form.values.password !== "" && !passwordIsValid && "password is not strong."),
209209
})}
210210
autoComplete="current-password"
211211
fullWidth

site/src/pages/SetupPage/SetupPageView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ export const SetupPageView: FC<SetupPageViewProps> = ({
183183
id="password"
184184
label={Language.passwordLabel}
185185
type="password"
186-
helperText={!passwordIsValid ? "Password is not strong." : ""} // Provide feedback
186+
helperText={form.values.password !== "" && !passwordIsValid ? "Password is not strong." : ""}
187187
/>
188188
<label
189189
htmlFor="trial"

site/src/pages/UserSettingsPage/SecurityPage/SecurityForm.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ export const SecurityForm: FC<SecurityFormProps> = ({
9696
autoComplete="password"
9797
fullWidth
9898
label={Language.newPasswordLabel}
99-
helperText={!passwordIsValid ? "Password is not strong." : ""} // Provide feedback
99+
helperText={form.values.password !== "" && !passwordIsValid ? "Password is not strong." : ""}
100100
type="password"
101101
/>
102102
<TextField

0 commit comments

Comments
 (0)