mirror of
https://github.com/coder/coder.git
synced 2025-07-12 00:14:10 +00:00
fix: improve password validation flow (#15132)
Refers to #14984 Currently, password validation is done backend side and is not explicit enough so it can be painful to create first users. We'd like to make this validation easier - but also duplicate it frontend side to make it smoother. Flows involved : - First user set password - New user set password - Change password --------- Co-authored-by: BrunoQuaresma <bruno_nonato_quaresma@hotmail.com>
This commit is contained in:
@ -6,9 +6,10 @@ import type * as TypesGen from "api/typesGenerated";
|
||||
import { ErrorAlert } from "components/Alert/ErrorAlert";
|
||||
import { FormFooter } from "components/FormFooter/FormFooter";
|
||||
import { FullPageForm } from "components/FullPageForm/FullPageForm";
|
||||
import { PasswordField } from "components/PasswordField/PasswordField";
|
||||
import { Stack } from "components/Stack/Stack";
|
||||
import { type FormikContextType, useFormik } from "formik";
|
||||
import type { FC } from "react";
|
||||
import { type FC, useEffect } from "react";
|
||||
import {
|
||||
displayNameValidator,
|
||||
getFormHelpers,
|
||||
@ -186,7 +187,7 @@ export const CreateUserForm: FC<
|
||||
);
|
||||
})}
|
||||
</TextField>
|
||||
<TextField
|
||||
<PasswordField
|
||||
{...getFieldHelpers("password", {
|
||||
helperText:
|
||||
form.values.login_type !== "password" &&
|
||||
@ -198,7 +199,6 @@ export const CreateUserForm: FC<
|
||||
data-testid="password-input"
|
||||
disabled={form.values.login_type !== "password"}
|
||||
label={Language.passwordLabel}
|
||||
type="password"
|
||||
/>
|
||||
</Stack>
|
||||
<FormFooter
|
||||
|
Reference in New Issue
Block a user