From e97a13e1e46298be9f334c8e6c6028fb8a99c53d Mon Sep 17 00:00:00 2001 From: soup Date: Tue, 4 Mar 2025 01:10:27 +0100 Subject: [PATCH] feat(ui): prevent password manager interference & improve service links (#1396) * feat(ui): prevent password manager interference & improve service links (#3989) (cherry picked from commit ef18b5d1de0bf2fe13975c3f488d90299fc717fe) * feat(ui): prevent password manager autofill on Jellyfin setup form * fix: rebase mess * feat(ui): set data-form-type attribute For Dashlane password manager * feat(ui): add data attribs for dashlane * feat(ui): set data-form-type to JellyfinLogin --- .../Common/SensitiveInput/index.tsx | 1 + src/components/Login/JellyfinLogin.tsx | 7 ++++++- src/components/Login/LocalLogin.tsx | 4 +++- .../Notifications/NotificationsDiscord.tsx | 1 + .../Notifications/NotificationsEmail.tsx | 6 ++++++ .../Notifications/NotificationsTelegram.tsx | 2 ++ src/components/Settings/RadarrModal/index.tsx | 1 + src/components/Settings/SettingsPlex.tsx | 3 +++ src/components/Settings/SonarrModal/index.tsx | 1 + src/components/Setup/JellyfinSetup.tsx | 20 +++++++++++++++++++ src/components/UserList/index.tsx | 1 + 11 files changed, 45 insertions(+), 2 deletions(-) diff --git a/src/components/Common/SensitiveInput/index.tsx b/src/components/Common/SensitiveInput/index.tsx index 9a92d254f..336044de6 100644 --- a/src/components/Common/SensitiveInput/index.tsx +++ b/src/components/Common/SensitiveInput/index.tsx @@ -26,6 +26,7 @@ const SensitiveInput = ({ as = 'input', ...props }: SensitiveInputProps) => { <> = ({ {({ errors, touched, isSubmitting, isValid }) => { return ( <> -
+

{intl.formatMessage(messages.loginwithapp, { @@ -140,6 +140,7 @@ const JellyfinLogin: React.FC = ({ type="text" placeholder={intl.formatMessage(messages.username)} className="!bg-gray-700/80 placeholder:text-gray-400" + data-form-type="username" />

{errors.username && touched.username && ( @@ -157,6 +158,10 @@ const JellyfinLogin: React.FC = ({ autoComplete="current-password" placeholder={intl.formatMessage(messages.password)} className="!bg-gray-700/80 placeholder:text-gray-400" + data-form-type="password" + data-1pignore="false" + data-lpignore="false" + data-bwignore="false" />
diff --git a/src/components/Login/LocalLogin.tsx b/src/components/Login/LocalLogin.tsx index 74bc1e393..169a5a8f5 100644 --- a/src/components/Login/LocalLogin.tsx +++ b/src/components/Login/LocalLogin.tsx @@ -75,7 +75,7 @@ const LocalLogin = ({ revalidate }: LocalLoginProps) => { {({ errors, touched, isSubmitting, isValid }) => { return ( <> - +

{intl.formatMessage(messages.loginwithapp, { @@ -94,6 +94,7 @@ const LocalLogin = ({ revalidate }: LocalLoginProps) => { type="text" inputMode="email" data-testid="email" + data-form-type="username,email" className="!bg-gray-700/80 placeholder:text-gray-400" />

@@ -113,6 +114,7 @@ const LocalLogin = ({ revalidate }: LocalLoginProps) => { placeholder={intl.formatMessage(messages.password)} autoComplete="current-password" data-testid="password" + data-form-type="password" className="!bg-gray-700/80 placeholder:text-gray-400" data-1pignore="false" data-lpignore="false" diff --git a/src/components/Settings/Notifications/NotificationsDiscord.tsx b/src/components/Settings/Notifications/NotificationsDiscord.tsx index d34edb649..928997006 100644 --- a/src/components/Settings/Notifications/NotificationsDiscord.tsx +++ b/src/components/Settings/Notifications/NotificationsDiscord.tsx @@ -239,6 +239,7 @@ const NotificationsDiscord = () => { type="text" placeholder={settings.currentSettings.applicationTitle} autoComplete="off" + data-form-type="other" data-1pignore="true" data-lpignore="true" data-bwignore="true" diff --git a/src/components/Settings/Notifications/NotificationsEmail.tsx b/src/components/Settings/Notifications/NotificationsEmail.tsx index 6daff08d7..ac3853ddc 100644 --- a/src/components/Settings/Notifications/NotificationsEmail.tsx +++ b/src/components/Settings/Notifications/NotificationsEmail.tsx @@ -296,6 +296,7 @@ const NotificationsEmail = () => { type="text" inputMode="email" autoComplete="off" + data-form-type="other" data-1pignore="true" data-lpignore="true" data-bwignore="true" @@ -321,6 +322,7 @@ const NotificationsEmail = () => { type="text" inputMode="url" autoComplete="off" + data-form-type="other" data-1pignore="true" data-lpignore="true" data-bwignore="true" @@ -346,6 +348,7 @@ const NotificationsEmail = () => { inputMode="numeric" className="short" autoComplete="off" + data-form-type="other" data-1pignore="true" data-lpignore="true" data-bwignore="true" @@ -407,6 +410,7 @@ const NotificationsEmail = () => { name="authUser" type="text" autoComplete="off" + data-form-type="other" data-1pignore="true" data-lpignore="true" data-bwignore="true" @@ -446,6 +450,7 @@ const NotificationsEmail = () => { rows="10" className="font-mono text-xs" autoComplete="off" + data-form-type="other" data-1pignore="true" data-lpignore="true" data-bwignore="true" @@ -477,6 +482,7 @@ const NotificationsEmail = () => { id="pgpPassword" name="pgpPassword" autoComplete="off" + data-form-type="other" data-1pignore="true" data-lpignore="true" data-bwignore="true" diff --git a/src/components/Settings/Notifications/NotificationsTelegram.tsx b/src/components/Settings/Notifications/NotificationsTelegram.tsx index bfac39fea..ad78a6606 100644 --- a/src/components/Settings/Notifications/NotificationsTelegram.tsx +++ b/src/components/Settings/Notifications/NotificationsTelegram.tsx @@ -269,6 +269,7 @@ const NotificationsTelegram = () => { name="botUsername" type="text" autoComplete="off" + data-form-type="other" data-1pignore="true" data-lpignore="true" data-bwignore="true" @@ -307,6 +308,7 @@ const NotificationsTelegram = () => { name="chatId" type="text" autoComplete="off" + data-form-type="other" data-1pignore="true" data-lpignore="true" data-bwignore="true" diff --git a/src/components/Settings/RadarrModal/index.tsx b/src/components/Settings/RadarrModal/index.tsx index b1ae42f7f..e63f49052 100644 --- a/src/components/Settings/RadarrModal/index.tsx +++ b/src/components/Settings/RadarrModal/index.tsx @@ -383,6 +383,7 @@ const RadarrModal = ({ onClose, radarr, onSave }: RadarrModalProps) => { name="name" type="text" autoComplete="off" + data-form-type="other" data-1pignore="true" data-lpignore="true" data-bwignore="true" diff --git a/src/components/Settings/SettingsPlex.tsx b/src/components/Settings/SettingsPlex.tsx index 2a2c6167d..5e2d5d4c0 100644 --- a/src/components/Settings/SettingsPlex.tsx +++ b/src/components/Settings/SettingsPlex.tsx @@ -873,6 +873,7 @@ const SettingsPlex = ({ onComplete }: SettingsPlexProps) => { name="tautulliPort" className="short" autoComplete="off" + data-form-type="other" data-1pignore="true" data-lpignore="true" data-bwignore="true" @@ -914,6 +915,7 @@ const SettingsPlex = ({ onComplete }: SettingsPlexProps) => { id="tautulliUrlBase" name="tautulliUrlBase" autoComplete="off" + data-form-type="other" data-1pignore="true" data-lpignore="true" data-bwignore="true" @@ -958,6 +960,7 @@ const SettingsPlex = ({ onComplete }: SettingsPlexProps) => { id="tautulliExternalUrl" name="tautulliExternalUrl" autoComplete="off" + data-form-type="other" data-1pignore="true" data-lpignore="true" data-bwignore="true" diff --git a/src/components/Settings/SonarrModal/index.tsx b/src/components/Settings/SonarrModal/index.tsx index 0728c54d8..11954734c 100644 --- a/src/components/Settings/SonarrModal/index.tsx +++ b/src/components/Settings/SonarrModal/index.tsx @@ -416,6 +416,7 @@ const SonarrModal = ({ onClose, sonarr, onSave }: SonarrModalProps) => { name="name" type="text" autoComplete="off" + data-form-type="other" data-1pignore="true" data-lpignore="true" data-bwignore="true" diff --git a/src/components/Setup/JellyfinSetup.tsx b/src/components/Setup/JellyfinSetup.tsx index 0a19bffa0..70be6eda8 100644 --- a/src/components/Setup/JellyfinSetup.tsx +++ b/src/components/Setup/JellyfinSetup.tsx @@ -198,6 +198,11 @@ function JellyfinSetup({ messages.hostname, mediaServerFormatValues )} + autoComplete="off" + data-form-type="other" + data-1pignore="true" + data-lpignore="true" + data-bwignore="true" />
{errors.hostname && touched.hostname && ( @@ -282,6 +287,11 @@ function JellyfinSetup({ name="email" type="text" placeholder={intl.formatMessage(messages.email)} + autoComplete="off" + data-form-type="other" + data-1pignore="true" + data-lpignore="true" + data-bwignore="true" /> {errors.email && touched.email && ( @@ -298,6 +308,11 @@ function JellyfinSetup({ name="username" type="text" placeholder={intl.formatMessage(messages.username)} + autoComplete="off" + data-form-type="other" + data-1pignore="true" + data-lpignore="true" + data-bwignore="true" /> {errors.username && touched.username && ( @@ -314,6 +329,11 @@ function JellyfinSetup({ name="password" type="password" placeholder={intl.formatMessage(messages.password)} + autoComplete="off" + data-form-type="other" + data-1pignore="true" + data-lpignore="true" + data-bwignore="true" /> {errors.password && touched.password && ( diff --git a/src/components/UserList/index.tsx b/src/components/UserList/index.tsx index ae76c6ad0..9a9778811 100644 --- a/src/components/UserList/index.tsx +++ b/src/components/UserList/index.tsx @@ -400,6 +400,7 @@ const UserList = () => { type="text" inputMode="email" autoComplete="off" + data-form-type="other" data-1pignore="true" data-lpignore="true" data-bwignore="true"