Unify password validation (#2077)

Passwords should be checked when created or changed in the frontend just as they are in the backend for REST and CLI.
Also extend the password validation to allow upto 1024 characters instead of 32.

Co-authored-by: Eduard Heimbuch <eduard.heimbuch@cloudogu.com>
This commit is contained in:
Florian Scholdei
2022-07-07 11:19:51 +02:00
committed by GitHub
parent 59abaa710a
commit f3f19426c8
25 changed files with 81 additions and 19 deletions

View File

@@ -50,7 +50,7 @@ const PasswordConfirmation: FC<InnerProps> = ({ passwordChanged, passwordValidat
return passwordValidator(newPassword);
}
return newPassword.length >= 6 && newPassword.length < 32;
return newPassword.length >= 6 && newPassword.length < 1024;
};
const handlePasswordValidationChange = (newConfirmedPassword: string) => {
@@ -76,7 +76,7 @@ const PasswordConfirmation: FC<InnerProps> = ({ passwordChanged, passwordValidat
<InputField
label={t("password.newPassword")}
type="password"
onChange={event => handlePasswordChange(event)}
onChange={(event) => handlePasswordChange(event)}
value={password}
validationError={!passwordValid}
errorMessage={t("password.passwordInvalid")}