Преглед на файлове

fix: disable password auto-complete

poeti8 преди 6 години
родител
ревизия
3959f6af3f

+ 3 - 2
client/components/Input.tsx

@@ -5,7 +5,7 @@ import { FC } from "react";
 
 import { Span } from "./Text";
 
-interface StyledSelectProps extends BoxProps {
+interface StyledTextProps extends BoxProps {
   autoFocus?: boolean;
   name?: string;
   id?: string;
@@ -16,11 +16,12 @@ interface StyledSelectProps extends BoxProps {
   placeholderSize?: number[];
   br?: string;
   bbw?: string;
+  autocomplete?: "on" | "off";
 }
 
 export const TextInput = styled(Flex).attrs({
   as: "input"
-})<StyledSelectProps>`
+})<StyledTextProps>`
   position: relative;
   box-sizing: border-box;
   letter-spacing: 0.05em;

+ 6 - 1
client/components/Settings/SettingsDeleteAccount.tsx

@@ -56,7 +56,12 @@ const SettingsDeleteAccount: FC = () => {
         Password
       </Text>
       <RowCenterV as="form" onSubmit={onSubmit}>
-        <TextInput placeholder="Password..." {...password("password")} mr={3} />
+        <TextInput
+          {...password("password")}
+          placeholder="Password..."
+          autocomplete="off"
+          mr={3}
+        />
         <Button color="red" type="submit" disabled={loading}>
           <Icon name={loading ? "spinner" : "trash"} mr={2} stroke="white" />
           {loading ? "Deleting..." : "Delete"}

+ 1 - 0
client/components/Settings/SettingsPassword.tsx

@@ -68,6 +68,7 @@ const SettingsPassword: FC = () => {
               }
             }
           })}
+          autocomplete="off"
           placeholder="New password..."
           width={[1, 2 / 3]}
           mr={3}

+ 2 - 0
client/components/Shortener.tsx

@@ -279,6 +279,7 @@ const Shortener = () => {
             <TextInput
               {...text("customurl")}
               placeholder="Custom address"
+              autocomplete="off"
               data-lpignore
               pl={[3, 24]}
               pr={[3, 24]}
@@ -301,6 +302,7 @@ const Shortener = () => {
             <TextInput
               {...password("password")}
               placeholder="Password"
+              autocomplete="off"
               data-lpignore
               pl={[3, 24]}
               pr={[3, 24]}

+ 1 - 0
client/pages/protected/[id].tsx

@@ -68,6 +68,7 @@ const ProtectedPage: NextPage<Props> = () => {
             <TextInput
               {...password("password")}
               placeholder="Password"
+              autocomplete="off"
               height={[44, 54]}
               width={[1, 1 / 2]}
               mr={3}