1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-08-02 12:25:22 +02:00

fix(auth): notify user password requirements [EE-3344] (#7042)

* fix(auth): notify user password requirements [EE-3344]

* fix angular code
This commit is contained in:
itsconquest 2022-06-15 16:01:19 +12:00 committed by GitHub
parent 41107191c3
commit 8059cae8e7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 27 additions and 7 deletions

View file

@ -1,7 +1,15 @@
import { react2angular } from '@/react-tools/react2angular';
import { usePublicSettings } from '@/portainer/settings/queries';
export function PasswordCheckHint() {
interface Props {
passwordValid: boolean;
forceChangePassword?: boolean;
}
export function PasswordCheckHint({
passwordValid,
forceChangePassword,
}: Props) {
const settingsQuery = usePublicSettings();
const minPasswordLength = settingsQuery.data?.RequiredPasswordLength;
@ -12,10 +20,18 @@ export function PasswordCheckHint() {
className="fa fa-exclamation-triangle orange-icon space-right"
aria-hidden="true"
/>
{forceChangePassword &&
'An administrator has changed your password requirements, '}
The password must be at least {minPasswordLength} characters long.
{passwordValid && (
<i className="fa fa-check green-icon space-left" aria-hidden="true" />
)}
</p>
</div>
);
}
export const PasswordCheckHintAngular = react2angular(PasswordCheckHint, []);
export const PasswordCheckHintAngular = react2angular(PasswordCheckHint, [
'passwordValid',
'forceChangePassword',
]);