feat: enable password generator for database inputs and disable it for profile settings

This commit is contained in:
Mauricio Siu
2026-01-12 09:19:22 -06:00
parent 5ddcdd843c
commit 18d980c3ff
7 changed files with 4 additions and 11 deletions
@@ -559,6 +559,7 @@ export const AddDatabase = ({ environmentId, projectName }: Props) => {
type="password" type="password"
placeholder="******************" placeholder="******************"
autoComplete="one-time-code" autoComplete="one-time-code"
enablePasswordGenerator={true}
{...field} {...field}
/> />
</FormControl> </FormControl>
@@ -578,6 +579,7 @@ export const AddDatabase = ({ environmentId, projectName }: Props) => {
<Input <Input
type="password" type="password"
placeholder="******************" placeholder="******************"
enablePasswordGenerator={true}
{...field} {...field}
/> />
</FormControl> </FormControl>
@@ -263,7 +263,6 @@ export const Configure2FA = () => {
type="password" type="password"
placeholder="Enter your password" placeholder="Enter your password"
{...field} {...field}
enablePasswordGenerator={false}
/> />
</FormControl> </FormControl>
<FormDescription> <FormDescription>
@@ -290,7 +290,6 @@ export const Enable2FA = () => {
type="password" type="password"
placeholder="Enter your password" placeholder="Enter your password"
{...field} {...field}
enablePasswordGenerator={false}
/> />
</FormControl> </FormControl>
<FormDescription> <FormDescription>
@@ -236,7 +236,6 @@ export const ProfileForm = () => {
placeholder={t("settings.profile.password")} placeholder={t("settings.profile.password")}
{...field} {...field}
value={field.value || ""} value={field.value || ""}
enablePasswordGenerator={false}
/> />
</FormControl> </FormControl>
<FormMessage /> <FormMessage />
@@ -568,7 +568,6 @@ export const SetupMonitoring = ({ serverId }: Props) => {
type={showToken ? "text" : "password"} type={showToken ? "text" : "password"}
placeholder="Enter your metrics token" placeholder="Enter your metrics token"
{...field} {...field}
enablePasswordGenerator={false}
/> />
<Button <Button
type="button" type="button"
@@ -10,12 +10,7 @@ export const ToggleVisibilityInput = ({ ...props }: InputProps) => {
return ( return (
<div className="flex w-full items-center space-x-2"> <div className="flex w-full items-center space-x-2">
<Input <Input ref={inputRef} {...props} type="password" />
ref={inputRef}
{...props}
type="password"
enablePasswordGenerator={false}
/>
<Button <Button
variant={"secondary"} variant={"secondary"}
onClick={() => { onClick={() => {
+1 -1
View File
@@ -16,7 +16,7 @@ const Input = React.forwardRef<HTMLInputElement, InputProps>(
className, className,
errorMessage, errorMessage,
type, type,
enablePasswordGenerator = true, enablePasswordGenerator = false,
passwordGeneratorLength, passwordGeneratorLength,
...props ...props
}, },