mirror of
https://github.com/portainer/portainer.git
synced 2025-08-02 20:35:25 +02:00
feat(password) EE-2690 enforce strong password policy (#6751)
* feat(password) EE-2690 enforce strong password policy * feat(password) EE-2690 disable create user button if password is not valid * feat(password) EE-2690 show force password change warning only when week password is detected * feat(password) EE-2690 prevent users leave account page by clicking add access token button Co-authored-by: Simon Meng <simon.meng@portainer.io>
This commit is contained in:
parent
9ebc963082
commit
85ad4e334a
26 changed files with 331 additions and 41 deletions
59
app/portainer/components/PasswordCheckHint.tsx
Normal file
59
app/portainer/components/PasswordCheckHint.tsx
Normal file
|
@ -0,0 +1,59 @@
|
|||
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>
|
||||
<p>
|
||||
<i
|
||||
className="fa fa-exclamation-triangle orange-icon"
|
||||
aria-hidden="true"
|
||||
/>
|
||||
<b> Please update your password to continue </b>
|
||||
</p>
|
||||
|
||||
<p className="text-muted">
|
||||
To ensure the security of your account, please update your password to a
|
||||
stronger password using a combination of at least 3 of the following:
|
||||
</p>
|
||||
|
||||
<PasswordCombination />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export function PasswordCheckHint() {
|
||||
return (
|
||||
<div>
|
||||
<p className="text-muted">
|
||||
<i className="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>
|
||||
</p>
|
||||
|
||||
<PasswordCombination />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export const ForcePasswordUpdateHintAngular = react2angular(
|
||||
ForcePasswordUpdateHint,
|
||||
[]
|
||||
);
|
||||
export const PasswordCheckHintAngular = react2angular(PasswordCheckHint, []);
|
Loading…
Add table
Add a link
Reference in a new issue