diff --git a/commafeed-client/src/app/types.ts b/commafeed-client/src/app/types.ts index 52b803c2..0b4d345b 100644 --- a/commafeed-client/src/app/types.ts +++ b/commafeed-client/src/app/types.ts @@ -228,6 +228,7 @@ export interface ServerInfo { treeReloadInterval: number forceRefreshCooldownDuration: number initialSetupRequired: boolean + minimumPasswordLength: number } export interface SharingSettings { diff --git a/commafeed-client/src/components/settings/ProfileSettings.tsx b/commafeed-client/src/components/settings/ProfileSettings.tsx index 57494b3b..a8e053eb 100644 --- a/commafeed-client/src/components/settings/ProfileSettings.tsx +++ b/commafeed-client/src/components/settings/ProfileSettings.tsx @@ -26,8 +26,13 @@ export function ProfileSettings() { const form = useForm({ validate: { + newPassword: value => + value && serverInfos && value.length < serverInfos.minimumPasswordLength + ? _(msg`Password must be at least ${serverInfos.minimumPasswordLength} characters`) + : null, newPasswordConfirmation: (value, values) => (value !== values.newPassword ? _(msg`Passwords do not match`) : null), }, + validateInputOnChange: true, }) const { setValues } = form diff --git a/commafeed-client/src/locales/ar/messages.po b/commafeed-client/src/locales/ar/messages.po index 9f620b6e..12c061f5 100644 --- a/commafeed-client/src/locales/ar/messages.po +++ b/commafeed-client/src/locales/ar/messages.po @@ -771,6 +771,13 @@ msgstr "الفئة الأصل" msgid "Password" msgstr "كلمة المرور" +#. placeholder {0}: serverInfos.minimumPasswordLength +#: src/components/settings/ProfileSettings.tsx +#: src/pages/auth/InitialSetupPage.tsx +#: src/pages/auth/RegistrationPage.tsx +msgid "Password must be at least {0} characters" +msgstr "" + #: src/pages/auth/PasswordRecoveryPage.tsx msgid "Password Recovery" msgstr "استعادة كلمة المرور" @@ -1056,10 +1063,6 @@ msgstr "إلغاء النجم" msgid "Unsubscribe" msgstr "إلغاء الاشتراك" -#: src/pages/auth/InitialSetupPage.tsx -msgid "User created." -msgstr "" - #: src/components/settings/ProfileSettings.tsx msgid "User name" msgstr "اسم المستخدم" diff --git a/commafeed-client/src/locales/ca/messages.po b/commafeed-client/src/locales/ca/messages.po index 078738c3..d68b3468 100644 --- a/commafeed-client/src/locales/ca/messages.po +++ b/commafeed-client/src/locales/ca/messages.po @@ -771,6 +771,13 @@ msgstr "Categoria pare" msgid "Password" msgstr "Contrasenya" +#. placeholder {0}: serverInfos.minimumPasswordLength +#: src/components/settings/ProfileSettings.tsx +#: src/pages/auth/InitialSetupPage.tsx +#: src/pages/auth/RegistrationPage.tsx +msgid "Password must be at least {0} characters" +msgstr "" + #: src/pages/auth/PasswordRecoveryPage.tsx msgid "Password Recovery" msgstr "Recuperació de contrasenya" @@ -1056,10 +1063,6 @@ msgstr "Desestrellar" msgid "Unsubscribe" msgstr "Donar-se de baixa" -#: src/pages/auth/InitialSetupPage.tsx -msgid "User created." -msgstr "" - #: src/components/settings/ProfileSettings.tsx msgid "User name" msgstr "Nom d'usuari" diff --git a/commafeed-client/src/locales/cs/messages.po b/commafeed-client/src/locales/cs/messages.po index c341a4e9..f584c53b 100644 --- a/commafeed-client/src/locales/cs/messages.po +++ b/commafeed-client/src/locales/cs/messages.po @@ -771,6 +771,13 @@ msgstr "Rodičovská kategorie" msgid "Password" msgstr "Heslo" +#. placeholder {0}: serverInfos.minimumPasswordLength +#: src/components/settings/ProfileSettings.tsx +#: src/pages/auth/InitialSetupPage.tsx +#: src/pages/auth/RegistrationPage.tsx +msgid "Password must be at least {0} characters" +msgstr "" + #: src/pages/auth/PasswordRecoveryPage.tsx msgid "Password Recovery" msgstr "Obnovení hesla" @@ -1056,10 +1063,6 @@ msgstr "Odstranit hvězdu" msgid "Unsubscribe" msgstr "Odhlásit odběr" -#: src/pages/auth/InitialSetupPage.tsx -msgid "User created." -msgstr "" - #: src/components/settings/ProfileSettings.tsx msgid "User name" msgstr "Uživatelské jméno" diff --git a/commafeed-client/src/locales/cy/messages.po b/commafeed-client/src/locales/cy/messages.po index 47931420..9bc03d42 100644 --- a/commafeed-client/src/locales/cy/messages.po +++ b/commafeed-client/src/locales/cy/messages.po @@ -771,6 +771,13 @@ msgstr "Categori Rhiant" msgid "Password" msgstr "cyfrinair" +#. placeholder {0}: serverInfos.minimumPasswordLength +#: src/components/settings/ProfileSettings.tsx +#: src/pages/auth/InitialSetupPage.tsx +#: src/pages/auth/RegistrationPage.tsx +msgid "Password must be at least {0} characters" +msgstr "" + #: src/pages/auth/PasswordRecoveryPage.tsx msgid "Password Recovery" msgstr "Adfer Cyfrinair" @@ -1056,10 +1063,6 @@ msgstr "dad-seren" msgid "Unsubscribe" msgstr "Dad-danysgrifio" -#: src/pages/auth/InitialSetupPage.tsx -msgid "User created." -msgstr "" - #: src/components/settings/ProfileSettings.tsx msgid "User name" msgstr "Enw defnyddiwr" diff --git a/commafeed-client/src/locales/da/messages.po b/commafeed-client/src/locales/da/messages.po index 68a6e022..0d70cef0 100644 --- a/commafeed-client/src/locales/da/messages.po +++ b/commafeed-client/src/locales/da/messages.po @@ -771,6 +771,13 @@ msgstr "Forældrekategori" msgid "Password" msgstr "Adgangskode" +#. placeholder {0}: serverInfos.minimumPasswordLength +#: src/components/settings/ProfileSettings.tsx +#: src/pages/auth/InitialSetupPage.tsx +#: src/pages/auth/RegistrationPage.tsx +msgid "Password must be at least {0} characters" +msgstr "" + #: src/pages/auth/PasswordRecoveryPage.tsx msgid "Password Recovery" msgstr "Gendannelse af adgangskode" @@ -1056,10 +1063,6 @@ msgstr "" msgid "Unsubscribe" msgstr "Afmeld" -#: src/pages/auth/InitialSetupPage.tsx -msgid "User created." -msgstr "" - #: src/components/settings/ProfileSettings.tsx msgid "User name" msgstr "Brugernavn" diff --git a/commafeed-client/src/locales/de/messages.po b/commafeed-client/src/locales/de/messages.po index 64c19f88..8458cf58 100644 --- a/commafeed-client/src/locales/de/messages.po +++ b/commafeed-client/src/locales/de/messages.po @@ -771,6 +771,13 @@ msgstr "Übergeordnete Kategorie" msgid "Password" msgstr "Passwort" +#. placeholder {0}: serverInfos.minimumPasswordLength +#: src/components/settings/ProfileSettings.tsx +#: src/pages/auth/InitialSetupPage.tsx +#: src/pages/auth/RegistrationPage.tsx +msgid "Password must be at least {0} characters" +msgstr "" + #: src/pages/auth/PasswordRecoveryPage.tsx msgid "Password Recovery" msgstr "Passwortwiederherstellung" @@ -1056,10 +1063,6 @@ msgstr "Stern entfernen" msgid "Unsubscribe" msgstr "Abbestellen" -#: src/pages/auth/InitialSetupPage.tsx -msgid "User created." -msgstr "" - #: src/components/settings/ProfileSettings.tsx msgid "User name" msgstr "Benutzername" diff --git a/commafeed-client/src/locales/en/messages.po b/commafeed-client/src/locales/en/messages.po index 665e8b7d..396d08d4 100644 --- a/commafeed-client/src/locales/en/messages.po +++ b/commafeed-client/src/locales/en/messages.po @@ -771,6 +771,13 @@ msgstr "Parent Category" msgid "Password" msgstr "Password" +#. placeholder {0}: serverInfos.minimumPasswordLength +#: src/components/settings/ProfileSettings.tsx +#: src/pages/auth/InitialSetupPage.tsx +#: src/pages/auth/RegistrationPage.tsx +msgid "Password must be at least {0} characters" +msgstr "Password must be at least {0} characters" + #: src/pages/auth/PasswordRecoveryPage.tsx msgid "Password Recovery" msgstr "Password Recovery" @@ -1056,10 +1063,6 @@ msgstr "Unstar" msgid "Unsubscribe" msgstr "Unsubscribe" -#: src/pages/auth/InitialSetupPage.tsx -msgid "User created." -msgstr "User created." - #: src/components/settings/ProfileSettings.tsx msgid "User name" msgstr "User name" diff --git a/commafeed-client/src/locales/es/messages.po b/commafeed-client/src/locales/es/messages.po index 5db8f771..098146cf 100644 --- a/commafeed-client/src/locales/es/messages.po +++ b/commafeed-client/src/locales/es/messages.po @@ -772,6 +772,13 @@ msgstr "Categoría principal" msgid "Password" msgstr "Contraseña" +#. placeholder {0}: serverInfos.minimumPasswordLength +#: src/components/settings/ProfileSettings.tsx +#: src/pages/auth/InitialSetupPage.tsx +#: src/pages/auth/RegistrationPage.tsx +msgid "Password must be at least {0} characters" +msgstr "" + #: src/pages/auth/PasswordRecoveryPage.tsx msgid "Password Recovery" msgstr "Recuperación de contraseña" @@ -1057,10 +1064,6 @@ msgstr "Desmarcar" msgid "Unsubscribe" msgstr "Cancelar suscripción" -#: src/pages/auth/InitialSetupPage.tsx -msgid "User created." -msgstr "" - #: src/components/settings/ProfileSettings.tsx msgid "User name" msgstr "Nombre de usuario" diff --git a/commafeed-client/src/locales/fa/messages.po b/commafeed-client/src/locales/fa/messages.po index 2aea41e9..6147e117 100644 --- a/commafeed-client/src/locales/fa/messages.po +++ b/commafeed-client/src/locales/fa/messages.po @@ -771,6 +771,13 @@ msgstr "دسته والد" msgid "Password" msgstr "رمز عبور" +#. placeholder {0}: serverInfos.minimumPasswordLength +#: src/components/settings/ProfileSettings.tsx +#: src/pages/auth/InitialSetupPage.tsx +#: src/pages/auth/RegistrationPage.tsx +msgid "Password must be at least {0} characters" +msgstr "" + #: src/pages/auth/PasswordRecoveryPage.tsx msgid "Password Recovery" msgstr "بازیابی رمز عبور" @@ -1056,10 +1063,6 @@ msgstr "" msgid "Unsubscribe" msgstr "لغو اشتراک" -#: src/pages/auth/InitialSetupPage.tsx -msgid "User created." -msgstr "" - #: src/components/settings/ProfileSettings.tsx msgid "User name" msgstr "نام کاربری" diff --git a/commafeed-client/src/locales/fi/messages.po b/commafeed-client/src/locales/fi/messages.po index 3db5e890..a271c837 100644 --- a/commafeed-client/src/locales/fi/messages.po +++ b/commafeed-client/src/locales/fi/messages.po @@ -771,6 +771,13 @@ msgstr "Pääluokka" msgid "Password" msgstr "Salasana" +#. placeholder {0}: serverInfos.minimumPasswordLength +#: src/components/settings/ProfileSettings.tsx +#: src/pages/auth/InitialSetupPage.tsx +#: src/pages/auth/RegistrationPage.tsx +msgid "Password must be at least {0} characters" +msgstr "" + #: src/pages/auth/PasswordRecoveryPage.tsx msgid "Password Recovery" msgstr "Salasanan palautus" @@ -1056,10 +1063,6 @@ msgstr "Poista tähti" msgid "Unsubscribe" msgstr "Peruuta tilaus" -#: src/pages/auth/InitialSetupPage.tsx -msgid "User created." -msgstr "" - #: src/components/settings/ProfileSettings.tsx msgid "User name" msgstr "Käyttäjänimi" diff --git a/commafeed-client/src/locales/fr/messages.po b/commafeed-client/src/locales/fr/messages.po index 1670cd9e..869d1763 100644 --- a/commafeed-client/src/locales/fr/messages.po +++ b/commafeed-client/src/locales/fr/messages.po @@ -771,6 +771,13 @@ msgstr "Catégorie parente" msgid "Password" msgstr "Mot de passe" +#. placeholder {0}: serverInfos.minimumPasswordLength +#: src/components/settings/ProfileSettings.tsx +#: src/pages/auth/InitialSetupPage.tsx +#: src/pages/auth/RegistrationPage.tsx +msgid "Password must be at least {0} characters" +msgstr "" + #: src/pages/auth/PasswordRecoveryPage.tsx msgid "Password Recovery" msgstr "Récupération de mot de passe" @@ -1056,10 +1063,6 @@ msgstr "Retirer des favoris" msgid "Unsubscribe" msgstr "Se désabonner" -#: src/pages/auth/InitialSetupPage.tsx -msgid "User created." -msgstr "Compte créé." - #: src/components/settings/ProfileSettings.tsx msgid "User name" msgstr "Nom" diff --git a/commafeed-client/src/locales/gl/messages.po b/commafeed-client/src/locales/gl/messages.po index 71fd61d8..de7ee3f1 100644 --- a/commafeed-client/src/locales/gl/messages.po +++ b/commafeed-client/src/locales/gl/messages.po @@ -772,6 +772,13 @@ msgstr "Categoría superior" msgid "Password" msgstr "Contrasinal" +#. placeholder {0}: serverInfos.minimumPasswordLength +#: src/components/settings/ProfileSettings.tsx +#: src/pages/auth/InitialSetupPage.tsx +#: src/pages/auth/RegistrationPage.tsx +msgid "Password must be at least {0} characters" +msgstr "" + #: src/pages/auth/PasswordRecoveryPage.tsx msgid "Password Recovery" msgstr "Recuperación do contrasinal" @@ -1057,10 +1064,6 @@ msgstr "Retirar estrela" msgid "Unsubscribe" msgstr "Cancelar a subscrición" -#: src/pages/auth/InitialSetupPage.tsx -msgid "User created." -msgstr "" - #: src/components/settings/ProfileSettings.tsx msgid "User name" msgstr "Identificador" diff --git a/commafeed-client/src/locales/hu/messages.po b/commafeed-client/src/locales/hu/messages.po index 59755906..53aa0b56 100644 --- a/commafeed-client/src/locales/hu/messages.po +++ b/commafeed-client/src/locales/hu/messages.po @@ -771,6 +771,13 @@ msgstr "Szülő kategória" msgid "Password" msgstr "Jelszó" +#. placeholder {0}: serverInfos.minimumPasswordLength +#: src/components/settings/ProfileSettings.tsx +#: src/pages/auth/InitialSetupPage.tsx +#: src/pages/auth/RegistrationPage.tsx +msgid "Password must be at least {0} characters" +msgstr "" + #: src/pages/auth/PasswordRecoveryPage.tsx msgid "Password Recovery" msgstr "Jelszó helyreállítás" @@ -1056,10 +1063,6 @@ msgstr "" msgid "Unsubscribe" msgstr "Leiratkozás" -#: src/pages/auth/InitialSetupPage.tsx -msgid "User created." -msgstr "" - #: src/components/settings/ProfileSettings.tsx msgid "User name" msgstr "Felhasználónév" diff --git a/commafeed-client/src/locales/id/messages.po b/commafeed-client/src/locales/id/messages.po index 4a9a0a70..bb1abd01 100644 --- a/commafeed-client/src/locales/id/messages.po +++ b/commafeed-client/src/locales/id/messages.po @@ -771,6 +771,13 @@ msgstr "Kategori Induk" msgid "Password" msgstr "Kata Sandi" +#. placeholder {0}: serverInfos.minimumPasswordLength +#: src/components/settings/ProfileSettings.tsx +#: src/pages/auth/InitialSetupPage.tsx +#: src/pages/auth/RegistrationPage.tsx +msgid "Password must be at least {0} characters" +msgstr "" + #: src/pages/auth/PasswordRecoveryPage.tsx msgid "Password Recovery" msgstr "Pemulihan Kata Sandi" @@ -1056,10 +1063,6 @@ msgstr "Hapus bintang" msgid "Unsubscribe" msgstr "Berhenti berlangganan" -#: src/pages/auth/InitialSetupPage.tsx -msgid "User created." -msgstr "" - #: src/components/settings/ProfileSettings.tsx msgid "User name" msgstr "Nama pengguna" diff --git a/commafeed-client/src/locales/it/messages.po b/commafeed-client/src/locales/it/messages.po index 14a4edbb..02fb849c 100644 --- a/commafeed-client/src/locales/it/messages.po +++ b/commafeed-client/src/locales/it/messages.po @@ -771,6 +771,13 @@ msgstr "Categoria padre" msgid "Password" msgstr "" +#. placeholder {0}: serverInfos.minimumPasswordLength +#: src/components/settings/ProfileSettings.tsx +#: src/pages/auth/InitialSetupPage.tsx +#: src/pages/auth/RegistrationPage.tsx +msgid "Password must be at least {0} characters" +msgstr "" + #: src/pages/auth/PasswordRecoveryPage.tsx msgid "Password Recovery" msgstr "Recupero password" @@ -1056,10 +1063,6 @@ msgstr "Elimina le stelle" msgid "Unsubscribe" msgstr "Annulla iscrizione" -#: src/pages/auth/InitialSetupPage.tsx -msgid "User created." -msgstr "" - #: src/components/settings/ProfileSettings.tsx msgid "User name" msgstr "Nome utente" diff --git a/commafeed-client/src/locales/ja/messages.po b/commafeed-client/src/locales/ja/messages.po index 31a54b54..1e99b3da 100644 --- a/commafeed-client/src/locales/ja/messages.po +++ b/commafeed-client/src/locales/ja/messages.po @@ -771,6 +771,13 @@ msgstr "親カテゴリ" msgid "Password" msgstr "パスワード" +#. placeholder {0}: serverInfos.minimumPasswordLength +#: src/components/settings/ProfileSettings.tsx +#: src/pages/auth/InitialSetupPage.tsx +#: src/pages/auth/RegistrationPage.tsx +msgid "Password must be at least {0} characters" +msgstr "" + #: src/pages/auth/PasswordRecoveryPage.tsx msgid "Password Recovery" msgstr "パスワード回復" @@ -1056,10 +1063,6 @@ msgstr "スターを外す" msgid "Unsubscribe" msgstr "退会" -#: src/pages/auth/InitialSetupPage.tsx -msgid "User created." -msgstr "" - #: src/components/settings/ProfileSettings.tsx msgid "User name" msgstr "ユーザー名" diff --git a/commafeed-client/src/locales/ko/messages.po b/commafeed-client/src/locales/ko/messages.po index 5b6c5100..3d18e825 100644 --- a/commafeed-client/src/locales/ko/messages.po +++ b/commafeed-client/src/locales/ko/messages.po @@ -771,6 +771,13 @@ msgstr "부모 카테고리" msgid "Password" msgstr "비밀번호" +#. placeholder {0}: serverInfos.minimumPasswordLength +#: src/components/settings/ProfileSettings.tsx +#: src/pages/auth/InitialSetupPage.tsx +#: src/pages/auth/RegistrationPage.tsx +msgid "Password must be at least {0} characters" +msgstr "" + #: src/pages/auth/PasswordRecoveryPage.tsx msgid "Password Recovery" msgstr "비밀번호 복구" @@ -1056,10 +1063,6 @@ msgstr "별표 제거" msgid "Unsubscribe" msgstr "구독 취소" -#: src/pages/auth/InitialSetupPage.tsx -msgid "User created." -msgstr "" - #: src/components/settings/ProfileSettings.tsx msgid "User name" msgstr "사용자 이름" diff --git a/commafeed-client/src/locales/ms/messages.po b/commafeed-client/src/locales/ms/messages.po index 0ba25395..1cfd71c5 100644 --- a/commafeed-client/src/locales/ms/messages.po +++ b/commafeed-client/src/locales/ms/messages.po @@ -771,6 +771,13 @@ msgstr "Kategori Induk" msgid "Password" msgstr "Kata Laluan" +#. placeholder {0}: serverInfos.minimumPasswordLength +#: src/components/settings/ProfileSettings.tsx +#: src/pages/auth/InitialSetupPage.tsx +#: src/pages/auth/RegistrationPage.tsx +msgid "Password must be at least {0} characters" +msgstr "" + #: src/pages/auth/PasswordRecoveryPage.tsx msgid "Password Recovery" msgstr "Pemulihan Kata Laluan" @@ -1056,10 +1063,6 @@ msgstr "Nyahbintang" msgid "Unsubscribe" msgstr "Nyahlanggan" -#: src/pages/auth/InitialSetupPage.tsx -msgid "User created." -msgstr "" - #: src/components/settings/ProfileSettings.tsx msgid "User name" msgstr "Nama pengguna" diff --git a/commafeed-client/src/locales/nb/messages.po b/commafeed-client/src/locales/nb/messages.po index 24f29335..b980fc45 100644 --- a/commafeed-client/src/locales/nb/messages.po +++ b/commafeed-client/src/locales/nb/messages.po @@ -771,6 +771,13 @@ msgstr "Overordnet kategori" msgid "Password" msgstr "Passord" +#. placeholder {0}: serverInfos.minimumPasswordLength +#: src/components/settings/ProfileSettings.tsx +#: src/pages/auth/InitialSetupPage.tsx +#: src/pages/auth/RegistrationPage.tsx +msgid "Password must be at least {0} characters" +msgstr "" + #: src/pages/auth/PasswordRecoveryPage.tsx msgid "Password Recovery" msgstr "Passordgjenoppretting" @@ -1056,10 +1063,6 @@ msgstr "Fjern stjerne" msgid "Unsubscribe" msgstr "Avslutt abonnementet" -#: src/pages/auth/InitialSetupPage.tsx -msgid "User created." -msgstr "" - #: src/components/settings/ProfileSettings.tsx msgid "User name" msgstr "Brukernavn" diff --git a/commafeed-client/src/locales/nl/messages.po b/commafeed-client/src/locales/nl/messages.po index f761adc6..eeef53fb 100644 --- a/commafeed-client/src/locales/nl/messages.po +++ b/commafeed-client/src/locales/nl/messages.po @@ -771,6 +771,13 @@ msgstr "Oudercategorie" msgid "Password" msgstr "Wachtwoord" +#. placeholder {0}: serverInfos.minimumPasswordLength +#: src/components/settings/ProfileSettings.tsx +#: src/pages/auth/InitialSetupPage.tsx +#: src/pages/auth/RegistrationPage.tsx +msgid "Password must be at least {0} characters" +msgstr "" + #: src/pages/auth/PasswordRecoveryPage.tsx msgid "Password Recovery" msgstr "Wachtwoordherstel" @@ -1056,10 +1063,6 @@ msgstr "Sterren uit" msgid "Unsubscribe" msgstr "Afmelden" -#: src/pages/auth/InitialSetupPage.tsx -msgid "User created." -msgstr "" - #: src/components/settings/ProfileSettings.tsx msgid "User name" msgstr "Gebruikersnaam" diff --git a/commafeed-client/src/locales/nn/messages.po b/commafeed-client/src/locales/nn/messages.po index 7a96078b..cd3bd38f 100644 --- a/commafeed-client/src/locales/nn/messages.po +++ b/commafeed-client/src/locales/nn/messages.po @@ -771,6 +771,13 @@ msgstr "Overordnet kategori" msgid "Password" msgstr "Passord" +#. placeholder {0}: serverInfos.minimumPasswordLength +#: src/components/settings/ProfileSettings.tsx +#: src/pages/auth/InitialSetupPage.tsx +#: src/pages/auth/RegistrationPage.tsx +msgid "Password must be at least {0} characters" +msgstr "" + #: src/pages/auth/PasswordRecoveryPage.tsx msgid "Password Recovery" msgstr "Passordgjenoppretting" @@ -1056,10 +1063,6 @@ msgstr "Fjern stjerne" msgid "Unsubscribe" msgstr "Avslutt abonnementet" -#: src/pages/auth/InitialSetupPage.tsx -msgid "User created." -msgstr "" - #: src/components/settings/ProfileSettings.tsx msgid "User name" msgstr "Brukernavn" diff --git a/commafeed-client/src/locales/pl/messages.po b/commafeed-client/src/locales/pl/messages.po index 9008775d..b2016705 100644 --- a/commafeed-client/src/locales/pl/messages.po +++ b/commafeed-client/src/locales/pl/messages.po @@ -771,6 +771,13 @@ msgstr "Kategoria nadrzędna" msgid "Password" msgstr "Hasło" +#. placeholder {0}: serverInfos.minimumPasswordLength +#: src/components/settings/ProfileSettings.tsx +#: src/pages/auth/InitialSetupPage.tsx +#: src/pages/auth/RegistrationPage.tsx +msgid "Password must be at least {0} characters" +msgstr "" + #: src/pages/auth/PasswordRecoveryPage.tsx msgid "Password Recovery" msgstr "Odzyskiwanie hasła" @@ -1056,10 +1063,6 @@ msgstr "" msgid "Unsubscribe" msgstr "Anuluj subskrypcję" -#: src/pages/auth/InitialSetupPage.tsx -msgid "User created." -msgstr "" - #: src/components/settings/ProfileSettings.tsx msgid "User name" msgstr "Nazwa użytkownika" diff --git a/commafeed-client/src/locales/pt/messages.po b/commafeed-client/src/locales/pt/messages.po index 078665a0..75cd8014 100644 --- a/commafeed-client/src/locales/pt/messages.po +++ b/commafeed-client/src/locales/pt/messages.po @@ -771,6 +771,13 @@ msgstr "Categoria Pai" msgid "Password" msgstr "Senha" +#. placeholder {0}: serverInfos.minimumPasswordLength +#: src/components/settings/ProfileSettings.tsx +#: src/pages/auth/InitialSetupPage.tsx +#: src/pages/auth/RegistrationPage.tsx +msgid "Password must be at least {0} characters" +msgstr "" + #: src/pages/auth/PasswordRecoveryPage.tsx msgid "Password Recovery" msgstr "Recuperação de Senha" @@ -1056,10 +1063,6 @@ msgstr "Desestrelar" msgid "Unsubscribe" msgstr "Cancelar inscrição" -#: src/pages/auth/InitialSetupPage.tsx -msgid "User created." -msgstr "" - #: src/components/settings/ProfileSettings.tsx msgid "User name" msgstr "Nome de usuário" diff --git a/commafeed-client/src/locales/ru/messages.po b/commafeed-client/src/locales/ru/messages.po index 90aad5ee..91a522e0 100644 --- a/commafeed-client/src/locales/ru/messages.po +++ b/commafeed-client/src/locales/ru/messages.po @@ -771,6 +771,13 @@ msgstr "Родительская категория" msgid "Password" msgstr "Пароль" +#. placeholder {0}: serverInfos.minimumPasswordLength +#: src/components/settings/ProfileSettings.tsx +#: src/pages/auth/InitialSetupPage.tsx +#: src/pages/auth/RegistrationPage.tsx +msgid "Password must be at least {0} characters" +msgstr "" + #: src/pages/auth/PasswordRecoveryPage.tsx msgid "Password Recovery" msgstr "Восстановление пароля" @@ -1056,10 +1063,6 @@ msgstr "Удалить из избранного" msgid "Unsubscribe" msgstr "Отписаться" -#: src/pages/auth/InitialSetupPage.tsx -msgid "User created." -msgstr "" - #: src/components/settings/ProfileSettings.tsx msgid "User name" msgstr "Имя пользователя" diff --git a/commafeed-client/src/locales/sk/messages.po b/commafeed-client/src/locales/sk/messages.po index a04c9bbb..41db68d9 100644 --- a/commafeed-client/src/locales/sk/messages.po +++ b/commafeed-client/src/locales/sk/messages.po @@ -771,6 +771,13 @@ msgstr "Rodičovská kategória" msgid "Password" msgstr "Heslo" +#. placeholder {0}: serverInfos.minimumPasswordLength +#: src/components/settings/ProfileSettings.tsx +#: src/pages/auth/InitialSetupPage.tsx +#: src/pages/auth/RegistrationPage.tsx +msgid "Password must be at least {0} characters" +msgstr "" + #: src/pages/auth/PasswordRecoveryPage.tsx msgid "Password Recovery" msgstr "Obnovenie hesla" @@ -1056,10 +1063,6 @@ msgstr "Odobrať hviezdičku" msgid "Unsubscribe" msgstr "Zrušte odber" -#: src/pages/auth/InitialSetupPage.tsx -msgid "User created." -msgstr "" - #: src/components/settings/ProfileSettings.tsx msgid "User name" msgstr "Meno používateľa" diff --git a/commafeed-client/src/locales/sv/messages.po b/commafeed-client/src/locales/sv/messages.po index c288b6b6..c3384600 100644 --- a/commafeed-client/src/locales/sv/messages.po +++ b/commafeed-client/src/locales/sv/messages.po @@ -771,6 +771,13 @@ msgstr "Föräldrakategori" msgid "Password" msgstr "Lösenord" +#. placeholder {0}: serverInfos.minimumPasswordLength +#: src/components/settings/ProfileSettings.tsx +#: src/pages/auth/InitialSetupPage.tsx +#: src/pages/auth/RegistrationPage.tsx +msgid "Password must be at least {0} characters" +msgstr "" + #: src/pages/auth/PasswordRecoveryPage.tsx msgid "Password Recovery" msgstr "Lösenordsåterställning" @@ -1056,10 +1063,6 @@ msgstr "" msgid "Unsubscribe" msgstr "Avregistrera" -#: src/pages/auth/InitialSetupPage.tsx -msgid "User created." -msgstr "" - #: src/components/settings/ProfileSettings.tsx msgid "User name" msgstr "Användarnamn" diff --git a/commafeed-client/src/locales/tr/messages.po b/commafeed-client/src/locales/tr/messages.po index 86810a82..8e44cb20 100644 --- a/commafeed-client/src/locales/tr/messages.po +++ b/commafeed-client/src/locales/tr/messages.po @@ -771,6 +771,13 @@ msgstr "Üst Kategori" msgid "Password" msgstr "Şifre" +#. placeholder {0}: serverInfos.minimumPasswordLength +#: src/components/settings/ProfileSettings.tsx +#: src/pages/auth/InitialSetupPage.tsx +#: src/pages/auth/RegistrationPage.tsx +msgid "Password must be at least {0} characters" +msgstr "" + #: src/pages/auth/PasswordRecoveryPage.tsx msgid "Password Recovery" msgstr "Parola Kurtarma" @@ -1056,10 +1063,6 @@ msgstr "Yıldızı kaldır" msgid "Unsubscribe" msgstr "Aboneliği iptal et" -#: src/pages/auth/InitialSetupPage.tsx -msgid "User created." -msgstr "" - #: src/components/settings/ProfileSettings.tsx msgid "User name" msgstr "Kullanıcı adı" diff --git a/commafeed-client/src/locales/zh/messages.po b/commafeed-client/src/locales/zh/messages.po index c5a801e4..9e3e3891 100644 --- a/commafeed-client/src/locales/zh/messages.po +++ b/commafeed-client/src/locales/zh/messages.po @@ -771,6 +771,13 @@ msgstr "父类别" msgid "Password" msgstr "密码" +#. placeholder {0}: serverInfos.minimumPasswordLength +#: src/components/settings/ProfileSettings.tsx +#: src/pages/auth/InitialSetupPage.tsx +#: src/pages/auth/RegistrationPage.tsx +msgid "Password must be at least {0} characters" +msgstr "" + #: src/pages/auth/PasswordRecoveryPage.tsx msgid "Password Recovery" msgstr "密码恢复" @@ -1056,10 +1063,6 @@ msgstr "取消星标" msgid "Unsubscribe" msgstr "取消订阅" -#: src/pages/auth/InitialSetupPage.tsx -msgid "User created." -msgstr "用户已创建。" - #: src/components/settings/ProfileSettings.tsx msgid "User name" msgstr "用户名" diff --git a/commafeed-client/src/pages/auth/InitialSetupPage.tsx b/commafeed-client/src/pages/auth/InitialSetupPage.tsx index 8ae83630..c4cb779c 100644 --- a/commafeed-client/src/pages/auth/InitialSetupPage.tsx +++ b/commafeed-client/src/pages/auth/InitialSetupPage.tsx @@ -6,12 +6,13 @@ import { useForm } from "@mantine/form" import { useAsyncCallback } from "react-async-hook" import { client, errorToStrings } from "@/app/client" import { redirectToRootCategory } from "@/app/redirect/thunks" -import { useAppDispatch } from "@/app/store" +import { useAppDispatch, useAppSelector } from "@/app/store" import type { InitialSetupRequest } from "@/app/types" import { Alert } from "@/components/Alert" import { PageTitle } from "@/pages/PageTitle" export function InitialSetupPage() { + const serverInfos = useAppSelector(state => state.server.serverInfos) const dispatch = useAppDispatch() const { _ } = useLingui() @@ -21,6 +22,13 @@ export function InitialSetupPage() { password: "", email: "", }, + validate: { + password: value => + serverInfos && value.length < serverInfos.minimumPasswordLength + ? _(msg`Password must be at least ${serverInfos.minimumPasswordLength} characters`) + : null, + }, + validateInputOnChange: true, }) const login = useAsyncCallback(client.user.login, { diff --git a/commafeed-client/src/pages/auth/RegistrationPage.tsx b/commafeed-client/src/pages/auth/RegistrationPage.tsx index 12664df4..d1f70e87 100644 --- a/commafeed-client/src/pages/auth/RegistrationPage.tsx +++ b/commafeed-client/src/pages/auth/RegistrationPage.tsx @@ -23,6 +23,13 @@ export function RegistrationPage() { password: "", email: "", }, + validate: { + password: value => + serverInfos && value.length < serverInfos.minimumPasswordLength + ? _(msg`Password must be at least ${serverInfos.minimumPasswordLength} characters`) + : null, + }, + validateInputOnChange: true, }) const login = useAsyncCallback(client.user.login, { diff --git a/commafeed-server/src/main/java/com/commafeed/frontend/model/ServerInfo.java b/commafeed-server/src/main/java/com/commafeed/frontend/model/ServerInfo.java index c472afd9..69412cc9 100644 --- a/commafeed-server/src/main/java/com/commafeed/frontend/model/ServerInfo.java +++ b/commafeed-server/src/main/java/com/commafeed/frontend/model/ServerInfo.java @@ -49,4 +49,7 @@ public class ServerInfo implements Serializable { @Schema(required = true) private boolean initialSetupRequired; + @Schema(required = true) + private int minimumPasswordLength; + } diff --git a/commafeed-server/src/main/java/com/commafeed/frontend/resource/ServerREST.java b/commafeed-server/src/main/java/com/commafeed/frontend/resource/ServerREST.java index c695c556..c782d02f 100644 --- a/commafeed-server/src/main/java/com/commafeed/frontend/resource/ServerREST.java +++ b/commafeed-server/src/main/java/com/commafeed/frontend/resource/ServerREST.java @@ -61,6 +61,7 @@ public class ServerREST { infos.setTreeReloadInterval(config.websocket().treeReloadInterval().toMillis()); infos.setForceRefreshCooldownDuration(config.feedRefresh().forceRefreshCooldownDuration().toMillis()); infos.setInitialSetupRequired(databaseStartupService.isInitialSetupRequired()); + infos.setMinimumPasswordLength(config.users().minimumPasswordLength()); return infos; } diff --git a/commafeed-server/src/test/java/com/commafeed/e2e/AuthentificationIT.java b/commafeed-server/src/test/java/com/commafeed/e2e/AuthentificationIT.java index ecbf67dc..fb5aa520 100644 --- a/commafeed-server/src/test/java/com/commafeed/e2e/AuthentificationIT.java +++ b/commafeed-server/src/test/java/com/commafeed/e2e/AuthentificationIT.java @@ -6,7 +6,6 @@ import org.junit.jupiter.api.Test; import com.commafeed.TestConstants; import com.microsoft.playwright.BrowserContext; -import com.microsoft.playwright.Locator; import com.microsoft.playwright.Page; import com.microsoft.playwright.assertions.PlaywrightAssertions; import com.microsoft.playwright.options.AriaRole; @@ -48,17 +47,6 @@ class AuthentificationIT { PlaywrightAssertions.assertThat(page).hasURL("http://localhost:8085/#/app/category/all"); } - @Test - void registerFailPasswordTooSimple() { - Page page = context.newPage(); - page.navigate(getLoginPageUrl()); - page.getByText("Sign up!").click(); - PlaywrightTestUtils.register(page, "user", "user@domain.com", "p"); - - Locator alert = page.getByRole(AriaRole.ALERT); - PlaywrightAssertions.assertThat(alert).containsText("Password must be 4 or more characters in length."); - } - @Test void registerSuccess() { Page page = context.newPage(); diff --git a/commafeed-server/src/test/java/com/commafeed/integration/rest/ServerIT.java b/commafeed-server/src/test/java/com/commafeed/integration/rest/ServerIT.java index af75a5eb..bfc09536 100644 --- a/commafeed-server/src/test/java/com/commafeed/integration/rest/ServerIT.java +++ b/commafeed-server/src/test/java/com/commafeed/integration/rest/ServerIT.java @@ -22,6 +22,7 @@ class ServerIT extends BaseIT { Assertions.assertEquals(900000, serverInfos.getWebsocketPingInterval()); Assertions.assertEquals(30000, serverInfos.getTreeReloadInterval()); Assertions.assertEquals(60000, serverInfos.getForceRefreshCooldownDuration()); + Assertions.assertEquals(4, serverInfos.getMinimumPasswordLength()); } }