mirror of
https://github.com/portainer/portainer.git
synced 2025-08-08 15:25:22 +02:00
fix(pwd) EE-3161 ease the minimum password restrictions to 12 characters (#6921)
* fix(pwd): EE-3161 ease the minimum password restrictions to 12 characters
This commit is contained in:
parent
d9d1d6bfaa
commit
16f8b737f1
5 changed files with 7 additions and 65 deletions
|
@ -2,17 +2,6 @@ import { react2angular } from '@/react-tools/react2angular';
|
|||
|
||||
import { MinPasswordLen } from '../helpers/password';
|
||||
|
||||
function PasswordCombination() {
|
||||
return (
|
||||
<ul className="text-muted">
|
||||
<li className="ml-8"> Special characters </li>
|
||||
<li className="ml-8"> Lower case characters </li>
|
||||
<li className="ml-8"> Upper case characters </li>
|
||||
<li className="ml-8"> Numeric characters </li>
|
||||
</ul>
|
||||
);
|
||||
}
|
||||
|
||||
export function ForcePasswordUpdateHint() {
|
||||
return (
|
||||
<div>
|
||||
|
@ -25,11 +14,8 @@ export function ForcePasswordUpdateHint() {
|
|||
</p>
|
||||
|
||||
<p className="text-muted">
|
||||
The password must be at least {MinPasswordLen} characters long,
|
||||
including a combination of one character of three of the below:
|
||||
The password must be at least {MinPasswordLen} characters long.
|
||||
</p>
|
||||
|
||||
<PasswordCombination />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
@ -42,12 +28,9 @@ export function PasswordCheckHint() {
|
|||
{' '}
|
||||
</i>
|
||||
<span>
|
||||
The password must be at least {MinPasswordLen} characters long,
|
||||
including a combination of one character of three of the below:
|
||||
The password must be at least {MinPasswordLen} characters long.
|
||||
</span>
|
||||
</p>
|
||||
|
||||
<PasswordCombination />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -4,19 +4,6 @@ function lengthCheck(password: string) {
|
|||
return password.length >= MinPasswordLen;
|
||||
}
|
||||
|
||||
function comboCheck(password: string) {
|
||||
let count = 0;
|
||||
const regexps = [/[a-z]/, /[A-Z]/, /[0-9]/, /[\W_]/];
|
||||
|
||||
regexps.forEach((re) => {
|
||||
if (password.match(re) != null) {
|
||||
count += 1;
|
||||
}
|
||||
});
|
||||
|
||||
return count >= 3;
|
||||
}
|
||||
|
||||
export function StrengthCheck(password: string) {
|
||||
return lengthCheck(password) && comboCheck(password);
|
||||
return lengthCheck(password);
|
||||
}
|
||||
|
|
|
@ -68,14 +68,8 @@
|
|||
<!-- it is a workaround for firefox that does not render component <force-password-update-hint> -->
|
||||
<p>
|
||||
<i class="fa fa-times red-icon space-right" aria-hidden="true"></i>
|
||||
<span>The password must be at least {{ MinPasswordLen }} characters long, including a combination of one character of three of the below:</span>
|
||||
<span>The password must be at least {{ MinPasswordLen }} characters long.</span>
|
||||
</p>
|
||||
<ul>
|
||||
<li class="ml-8"> Special characters </li>
|
||||
<li class="ml-8"> Lower case characters </li>
|
||||
<li class="ml-8"> Upper case characters </li>
|
||||
<li class="ml-8"> Numeric characters </li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<!-- !note -->
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue