diff --git a/studio-ui/ui/app/src/components/AccountManagement/AccountManagement.tsx b/studio-ui/ui/app/src/components/AccountManagement/AccountManagement.tsx index f0ac0fcdb..d209b3bd9 100644 --- a/studio-ui/ui/app/src/components/AccountManagement/AccountManagement.tsx +++ b/studio-ui/ui/app/src/components/AccountManagement/AccountManagement.tsx @@ -59,6 +59,7 @@ import { setStoredEnableAnimations, setStoredSnackbarDuration } from '../../utils/state'; +import { USER_PASSWORD_MAX_LENGTH } from '../UserManagement/utils'; const decrementButtonSx: BoxProps['sx'] = { borderTopRightRadius: 0, @@ -279,6 +280,9 @@ export function AccountManagement(props: AccountManagementProps) { onChange={(e) => { setCurrentPassword(e.target.value); }} + slotProps={{ + htmlInput: { maxLength: USER_PASSWORD_MAX_LENGTH, autoComplete: 'current-password' } + }} /> setAnchorEl(e.target)} onBlur={() => setAnchorEl(null)} - inputProps={{ autoComplete: 'new-password' }} + slotProps={{ + htmlInput: { maxLength: USER_PASSWORD_MAX_LENGTH, autoComplete: 'new-password' } + }} /> ) } + slotProps={{ + htmlInput: { maxLength: USER_PASSWORD_MAX_LENGTH, autoComplete: 'new-password' } + }} /> setAnchorEl(e.target)} onBlur={() => setAnchorEl(null)} - inputProps={{ autoComplete: 'new-password' }} + slotProps={{ + htmlInput: { maxLength: USER_PASSWORD_MAX_LENGTH, autoComplete: 'new-password' } + }} /> {children} diff --git a/studio-ui/ui/app/src/components/PasswordTextField/PasswordTextField.tsx b/studio-ui/ui/app/src/components/PasswordTextField/PasswordTextField.tsx index ac5c91108..77616a5d5 100644 --- a/studio-ui/ui/app/src/components/PasswordTextField/PasswordTextField.tsx +++ b/studio-ui/ui/app/src/components/PasswordTextField/PasswordTextField.tsx @@ -37,7 +37,7 @@ const translations = defineMessages({ }); const PasswordTextField = React.forwardRef((props, ref) => { - const { visibilitySwitch = true, initialVisible = false, sxs } = props; + const { visibilitySwitch = true, initialVisible = false, sxs, slotProps, InputProps, ...textFieldProps } = props; const { formatMessage } = useIntl(); const [showPassword, setShowPassword] = useState(initialVisible); const inputRef = useRef(undefined); @@ -50,33 +50,41 @@ const PasswordTextField = React.forwardRef + + {showPassword ? : } + + + ); + return ( - - {showPassword ? : } - - - ) + ...slotProps?.input, + ...InputProps, + endAdornment: visibilityAdornment + } + : { + ...slotProps?.input, + ...InputProps } - : props.InputProps }} /> ); diff --git a/studio-ui/ui/app/src/components/ResetPasswordDialog/ResetPasswordDialog.tsx b/studio-ui/ui/app/src/components/ResetPasswordDialog/ResetPasswordDialog.tsx index 5044a7c18..1eabc985d 100644 --- a/studio-ui/ui/app/src/components/ResetPasswordDialog/ResetPasswordDialog.tsx +++ b/studio-ui/ui/app/src/components/ResetPasswordDialog/ResetPasswordDialog.tsx @@ -30,6 +30,7 @@ import { showSystemNotification } from '../../state/actions/system'; import PasswordTextField from '../PasswordTextField/PasswordTextField'; import { PasswordStrengthDisplayPopper } from '../PasswordStrengthDisplayPopper'; import { pushErrorDialog } from '../../utils/system'; +import { USER_PASSWORD_MAX_LENGTH } from '../UserManagement/utils'; interface ResetPasswordDialogProps { open: boolean; @@ -109,7 +110,9 @@ function ResetPasswordDialogUI(props: ResetPasswordDialogProps) { }} onFocus={(e) => setAnchorEl(e.target)} onBlur={() => setAnchorEl(null)} - inputProps={{ autoComplete: 'new-password' }} + slotProps={{ + htmlInput: { maxLength: USER_PASSWORD_MAX_LENGTH, autoComplete: 'new-password' } + }} />