From: SleeplessOne1917 Date: Mon, 7 Aug 2023 16:51:19 +0000 (-0400) Subject: Fix password autocomplete (#2033) X-Git-Url: http://these/git/ui/assets/static/readmes/README.ja.md?a=commitdiff_plain;h=61e0241d8930badc4a77cd973c3cbb64bd13c49e;p=lemmy-ui.git Fix password autocomplete (#2033) --- diff --git a/src/shared/components/common/password-input.tsx b/src/shared/components/common/password-input.tsx index 4298008..20cbadd 100644 --- a/src/shared/components/common/password-input.tsx +++ b/src/shared/components/common/password-input.tsx @@ -14,6 +14,7 @@ interface PasswordInputProps { showStrength?: boolean; label?: string | null; showForgotLink?: boolean; + isNew?: boolean; } interface PasswordInputState { @@ -73,6 +74,7 @@ class PasswordInput extends Component { showStrength, label, showForgotLink, + isNew, }, state: { show }, } = this; @@ -91,7 +93,7 @@ class PasswordInput extends Component { type={show ? "text" : "password"} className="form-control" aria-describedby={id} - autoComplete="on" + autoComplete={isNew ? "new-password" : "current-password"} onInput={onInput} value={value} required diff --git a/src/shared/components/home/setup.tsx b/src/shared/components/home/setup.tsx index 7dd433a..0a3d09f 100644 --- a/src/shared/components/home/setup.tsx +++ b/src/shared/components/home/setup.tsx @@ -128,6 +128,7 @@ export class Setup extends Component { value={this.state.form.password} onInput={linkEvent(this, this.handleRegisterPasswordChange)} label={I18NextService.i18n.t("password")} + isNew />
@@ -136,6 +137,7 @@ export class Setup extends Component { value={this.state.form.password_verify} onInput={linkEvent(this, this.handleRegisterPasswordVerifyChange)} label={I18NextService.i18n.t("verify_password")} + isNew />
diff --git a/src/shared/components/home/signup.tsx b/src/shared/components/home/signup.tsx index fce37f9..58324be 100644 --- a/src/shared/components/home/signup.tsx +++ b/src/shared/components/home/signup.tsx @@ -189,6 +189,7 @@ export class Signup extends Component { onInput={linkEvent(this, this.handleRegisterPasswordChange)} showStrength label={I18NextService.i18n.t("password")} + isNew />
@@ -198,6 +199,7 @@ export class Signup extends Component { value={this.state.form.password_verify} onInput={linkEvent(this, this.handleRegisterPasswordVerifyChange)} label={I18NextService.i18n.t("verify_password")} + isNew /> diff --git a/src/shared/components/person/password-change.tsx b/src/shared/components/person/password-change.tsx index bfbeb71..16f23d4 100644 --- a/src/shared/components/person/password-change.tsx +++ b/src/shared/components/person/password-change.tsx @@ -68,6 +68,7 @@ export class PasswordChange extends Component { onInput={linkEvent(this, this.handlePasswordChange)} showStrength label={I18NextService.i18n.t("new_password")} + isNew />
diff --git a/src/shared/components/person/settings.tsx b/src/shared/components/person/settings.tsx index 4b21d40..d045047 100644 --- a/src/shared/components/person/settings.tsx +++ b/src/shared/components/person/settings.tsx @@ -264,7 +264,7 @@ export class Settings extends Component { ); } - userSettings(isSelected) { + userSettings(isSelected: boolean) { return (
{ ); } - blockCards(isSelected) { + blockCards(isSelected: boolean) { return (
{ onInput={linkEvent(this, this.handleNewPasswordChange)} showStrength label={I18NextService.i18n.t("new_password")} + isNew />
@@ -334,6 +335,7 @@ export class Settings extends Component { value={this.state.changePasswordForm.new_password_verify} onInput={linkEvent(this, this.handleNewPasswordVerifyChange)} label={I18NextService.i18n.t("verify_password")} + isNew />