diff --git a/app/portainer/settings/authentication/internal-auth/InternalAuth.tsx b/app/portainer/settings/authentication/internal-auth/InternalAuth.tsx index 78c7cf178..51cc1bf00 100644 --- a/app/portainer/settings/authentication/internal-auth/InternalAuth.tsx +++ b/app/portainer/settings/authentication/internal-auth/InternalAuth.tsx @@ -1,5 +1,6 @@ import { FormSectionTitle } from '@/portainer/components/form-components/FormSectionTitle'; import { react2angular } from '@/react-tools/react2angular'; +import { confirm } from '@/portainer/services/modal.service/confirm'; import { SaveAuthSettingsButton } from '../components/SaveAuthSettingsButton'; import { Settings } from '../../types'; @@ -19,6 +20,27 @@ export function InternalAuth({ value, onChange, }: Props) { + function onSubmit() { + if (value.RequiredPasswordLength < 10) { + confirm({ + title: 'Allow weak passwords?', + message: + 'You have set an insecure minimum password length. This could leave your system vulnerable to attack, are you sure?', + buttons: { + confirm: { + label: 'Yes', + className: 'btn-danger', + }, + }, + callback: function onConfirm(confirmed) { + if (confirmed) onSaveSettings(); + }, + }); + } else { + onSaveSettings(); + } + } + return ( <> Information @@ -34,7 +56,7 @@ export function InternalAuth({
- + ); }