2022-06-03 04:00:13 +00:00
|
|
|
import { usePublicSettings } from '@/portainer/settings/queries';
|
2022-04-14 01:45:54 +00:00
|
|
|
|
2022-07-26 05:17:54 +00:00
|
|
|
import { Icon } from '@@/Icon';
|
|
|
|
|
2022-06-15 04:01:19 +00:00
|
|
|
interface Props {
|
|
|
|
passwordValid: boolean;
|
|
|
|
forceChangePassword?: boolean;
|
|
|
|
}
|
|
|
|
|
|
|
|
export function PasswordCheckHint({
|
|
|
|
passwordValid,
|
|
|
|
forceChangePassword,
|
|
|
|
}: Props) {
|
2022-06-03 04:00:13 +00:00
|
|
|
const settingsQuery = usePublicSettings();
|
|
|
|
const minPasswordLength = settingsQuery.data?.RequiredPasswordLength;
|
2022-04-14 01:45:54 +00:00
|
|
|
|
|
|
|
return (
|
|
|
|
<div>
|
2022-07-26 05:17:54 +00:00
|
|
|
<p className="text-muted vertical-center">
|
|
|
|
<Icon icon="alert-triangle" className="icon-warning" feather />
|
2022-06-15 04:01:19 +00:00
|
|
|
{forceChangePassword &&
|
|
|
|
'An administrator has changed your password requirements, '}
|
2022-06-03 04:00:13 +00:00
|
|
|
The password must be at least {minPasswordLength} characters long.
|
2022-06-15 04:01:19 +00:00
|
|
|
{passwordValid && (
|
|
|
|
<i className="fa fa-check green-icon space-left" aria-hidden="true" />
|
|
|
|
)}
|
2022-04-14 01:45:54 +00:00
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|