]> Untitled Git - lemmy-ui.git/commitdiff
Fix password autocomplete (#2033)
authorSleeplessOne1917 <abias1122@gmail.com>
Mon, 7 Aug 2023 16:51:19 +0000 (12:51 -0400)
committerGitHub <noreply@github.com>
Mon, 7 Aug 2023 16:51:19 +0000 (12:51 -0400)
src/shared/components/common/password-input.tsx
src/shared/components/home/setup.tsx
src/shared/components/home/signup.tsx
src/shared/components/person/password-change.tsx
src/shared/components/person/settings.tsx

index 429800896ab3556726b1e6a17bc86fd16dfd26ac..20cbadd4c42c6ca68619847bb8113a943e98c62a 100644 (file)
@@ -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<PasswordInputProps, PasswordInputState> {
         showStrength,
         label,
         showForgotLink,
+        isNew,
       },
       state: { show },
     } = this;
@@ -91,7 +93,7 @@ class PasswordInput extends Component<PasswordInputProps, PasswordInputState> {
                 type={show ? "text" : "password"}
                 className="form-control"
                 aria-describedby={id}
-                autoComplete="on"
+                autoComplete={isNew ? "new-password" : "current-password"}
                 onInput={onInput}
                 value={value}
                 required
index 7dd433ab51a622e02ab0377488a4f7c769143b66..0a3d09fe537b1551405b973b5a5898076f9b63e1 100644 (file)
@@ -128,6 +128,7 @@ export class Setup extends Component<any, State> {
             value={this.state.form.password}
             onInput={linkEvent(this, this.handleRegisterPasswordChange)}
             label={I18NextService.i18n.t("password")}
+            isNew
           />
         </div>
         <div className="mb-3">
@@ -136,6 +137,7 @@ export class Setup extends Component<any, State> {
             value={this.state.form.password_verify}
             onInput={linkEvent(this, this.handleRegisterPasswordVerifyChange)}
             label={I18NextService.i18n.t("verify_password")}
+            isNew
           />
         </div>
         <div className="mb-3 row">
index fce37f97e73d11b5bccdcecff03b918daede037b..58324beff466fda9d959915f86bd5d201c449fa1 100644 (file)
@@ -189,6 +189,7 @@ export class Signup extends Component<any, State> {
             onInput={linkEvent(this, this.handleRegisterPasswordChange)}
             showStrength
             label={I18NextService.i18n.t("password")}
+            isNew
           />
         </div>
 
@@ -198,6 +199,7 @@ export class Signup extends Component<any, State> {
             value={this.state.form.password_verify}
             onInput={linkEvent(this, this.handleRegisterPasswordVerifyChange)}
             label={I18NextService.i18n.t("verify_password")}
+            isNew
           />
         </div>
 
index bfbeb716f36042d4485568fc2ae7bd2b9a7cde96..16f23d4b85c9dc2d25d3de79437ff4fc0ddc5415 100644 (file)
@@ -68,6 +68,7 @@ export class PasswordChange extends Component<any, State> {
             onInput={linkEvent(this, this.handlePasswordChange)}
             showStrength
             label={I18NextService.i18n.t("new_password")}
+            isNew
           />
         </div>
         <div className="mb-3">
index 4b21d4069495f5dbf80767d59e9e61e838f333bc..d04504704fa67544aa196e5d1f086e5bc7143230 100644 (file)
@@ -264,7 +264,7 @@ export class Settings extends Component<any, SettingsState> {
     );
   }
 
-  userSettings(isSelected) {
+  userSettings(isSelected: boolean) {
     return (
       <div
         className={classNames("tab-pane show", {
@@ -289,7 +289,7 @@ export class Settings extends Component<any, SettingsState> {
     );
   }
 
-  blockCards(isSelected) {
+  blockCards(isSelected: boolean) {
     return (
       <div
         className={classNames("tab-pane", {
@@ -326,6 +326,7 @@ export class Settings extends Component<any, SettingsState> {
               onInput={linkEvent(this, this.handleNewPasswordChange)}
               showStrength
               label={I18NextService.i18n.t("new_password")}
+              isNew
             />
           </div>
           <div className="mb-3">
@@ -334,6 +335,7 @@ export class Settings extends Component<any, SettingsState> {
               value={this.state.changePasswordForm.new_password_verify}
               onInput={linkEvent(this, this.handleNewPasswordVerifyChange)}
               label={I18NextService.i18n.t("verify_password")}
+              isNew
             />
           </div>
           <div className="mb-3">