Skip to content

Commit

Permalink
feat: disable autocomplete on other form fields (#2595)
Browse files Browse the repository at this point in the history
* feat: disable autocomplet on other form fields
don't allow password manager to fill password field other then fields on unlock screen
add types to text fields
signed-off-by: pavan joshi <[email protected]>

* fix: remove all the instances of type=text
  • Loading branch information
pavanjoshi914 authored Jul 28, 2023
1 parent 99e6bc7 commit 84fe120
Show file tree
Hide file tree
Showing 16 changed files with 15 additions and 16 deletions.
3 changes: 0 additions & 3 deletions src/app/screens/Accounts/Detail/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,6 @@ function AccountDetail() {
id="name"
label={t("name.title")}
placeholder={t("name.placeholder")}
type="text"
value={accountName}
onChange={(event) => {
setAccountName(event.target.value);
Expand Down Expand Up @@ -294,7 +293,6 @@ function AccountDetail() {
<TextField
id="uri"
label={t("export.export_uri")}
type="text"
readOnly
value={`lndhub://${lndHubData.login}:${lndHubData.password}@${lndHubData.url}/`}
/>
Expand Down Expand Up @@ -389,7 +387,6 @@ function AccountDetail() {
<TextField
id="nostrPublicKey"
label={t("nostr.public_key.label")}
type="text"
value={nostrPublicKey}
disabled
endAdornment={
Expand Down
2 changes: 1 addition & 1 deletion src/app/screens/Accounts/NostrSettings/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ function NostrSettings() {
<TextField
id="nostrPrivateKey"
label={t("nostr.private_key.label")}
autoComplete="new-password"
type={nostrPrivateKeyVisible ? "text" : "password"}
value={nostrPrivateKey}
onChange={(event) => {
Expand Down Expand Up @@ -197,7 +198,6 @@ function NostrSettings() {
<TextField
id="nostrPublicKey"
label={t("nostr.public_key.label")}
type="text"
value={nostrPublicKey}
disabled
endAdornment={<InputCopyButton value={nostrPublicKey} />}
Expand Down
1 change: 0 additions & 1 deletion src/app/screens/Settings/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,6 @@ function Settings() {
<div className="w-64">
<Input
placeholder={t("name.placeholder")}
type="text"
value={settings.userName}
onChange={(event) => {
saveSetting({
Expand Down
2 changes: 1 addition & 1 deletion src/app/screens/connectors/ConnectCitadel/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ export default function ConnectCitadel() {
<TextField
label={t("password.label")}
id="password"
autoComplete="new-password"
type={passwordView ? "text" : "password"}
autoFocus={true}
required
Expand All @@ -138,7 +139,6 @@ export default function ConnectCitadel() {
label={t("url.label")}
id="url"
placeholder={t("url.placeholder")}
type="text"
value={formData.url}
required
onChange={handleChange}
Expand Down
5 changes: 1 addition & 4 deletions src/app/screens/connectors/ConnectCommando/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ export default function ConnectCommando() {
<TextField
id="host"
label={t("host.label")}
type="text"
required
placeholder="0.0.0.0"
title="host"
Expand All @@ -127,7 +126,6 @@ export default function ConnectCommando() {
<TextField
id="pubkey"
label={t("pubkey.label")}
type="text"
required
placeholder="02...."
title="pubkey"
Expand All @@ -139,7 +137,6 @@ export default function ConnectCommando() {
<TextField
id="rune"
label={t("rune.label")}
type="text"
required
placeholder=""
title="rune"
Expand Down Expand Up @@ -170,7 +167,6 @@ export default function ConnectCommando() {
<TextField
id="proxy"
label={t("proxy.label")}
type="text"
placeholder="proxy"
required
title="proxy"
Expand All @@ -182,6 +178,7 @@ export default function ConnectCommando() {
id="commandoPrivateKey"
label={t("privKey.label")}
type={commandoPrivateKeyVisible ? "text" : "password"}
autoComplete="new-password"
value={formData.privateKey}
endAdornment={
<button
Expand Down
2 changes: 1 addition & 1 deletion src/app/screens/connectors/ConnectEclair/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ export default function ConnectEclair() {
<div className="mb-6">
<TextField
id="password"
autoComplete="new-password"
label={t("password.label")}
type={passwordView ? "text" : "password"}
required
Expand All @@ -121,7 +122,6 @@ export default function ConnectEclair() {
<TextField
id="url"
label={t("url.label")}
type="text"
placeholder={t("url.placeholder")}
value={formData.url}
required
Expand Down
1 change: 0 additions & 1 deletion src/app/screens/connectors/ConnectGaloy/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,6 @@ export default function ConnectGaloy(props: Props) {
<Input
id="jwt"
name="jwt"
type="text"
required
onChange={handleJwtChange}
autoFocus={true}
Expand Down
1 change: 0 additions & 1 deletion src/app/screens/connectors/ConnectKollider/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ export default function ConnectKollidier({ variant }: Props) {
<TextField
id="username"
label={t(`username.label`)}
type="text"
required
value={formData.username}
onChange={handleChange}
Expand Down
2 changes: 0 additions & 2 deletions src/app/screens/connectors/ConnectLnbits/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ export default function ConnectLnbits() {
id="adminkey"
label={t("admin_key.label")}
placeholder={t("admin_key.placeholder")}
type="text"
required
onChange={handleChange}
autoFocus={true}
Expand All @@ -118,7 +117,6 @@ export default function ConnectLnbits() {
<TextField
id="url"
label={t("url.label")}
type="text"
value={formData.url}
required
onChange={handleChange}
Expand Down
1 change: 1 addition & 0 deletions src/app/screens/connectors/ConnectLnc/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ export default function ConnectLnd() {
<div className="mt-6">
<TextField
id="pairingPhrase"
autoComplete="new-password"
type="password"
label={t("pairing_phrase.label")}
placeholder={t("pairing_phrase.placeholder")}
Expand Down
2 changes: 2 additions & 0 deletions src/app/screens/connectors/ConnectLnd/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@ export default function ConnectLnd() {
<div>
<TextField
id="macaroon"
type="password"
autoComplete="new-password"
label={t("macaroon.label")}
value={formData.macaroon}
onChange={handleChange}
Expand Down
1 change: 0 additions & 1 deletion src/app/screens/connectors/ConnectLndHub/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ export default function ConnectLndHub({
<TextField
id="uri"
label={t("uri.label")}
type="text"
required
placeholder="lndhub://..."
pattern="lndhub://.+"
Expand Down
2 changes: 2 additions & 0 deletions src/app/screens/connectors/ConnectMyNode/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ export default function ConnectMyNode() {
<TextField
id="lndconnect"
label={t("rest_url.label")}
type="password"
autoComplete="new-password"
placeholder={t("rest_url.placeholder")}
onChange={handleLndconnectUrl}
required
Expand Down
2 changes: 2 additions & 0 deletions src/app/screens/connectors/ConnectRaspiBlitz/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,8 @@ export default function ConnectRaspiBlitz() {
<div>
<TextField
id="macaroon"
type="password"
autoComplete="new-password"
label="Macaroon (HEX format)"
value={formData.macaroon}
onChange={handleMacaroon}
Expand Down
2 changes: 2 additions & 0 deletions src/app/screens/connectors/ConnectStart9/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ export default function ConnectStart9() {
<div className="mt-6">
<TextField
id="lndconnect"
type="password"
autoComplete="new-password"
label={t("rest_url.label")}
placeholder={t("rest_url.placeholder")}
onChange={handleLndconnectUrl}
Expand Down
2 changes: 2 additions & 0 deletions src/app/screens/connectors/ConnectUmbrel/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ export default function ConnectUmbrel() {
<div className="mt-6">
<TextField
id="lndconnect"
type="password"
autoComplete="new-password"
label={t("rest_url.label")}
placeholder={t("rest_url.placeholder")}
onChange={handleLndconnectUrl}
Expand Down

0 comments on commit 84fe120

Please sign in to comment.