Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/cqi 149: password validator for user form creation #104

Merged
merged 3 commits into from
May 22, 2024

Conversation

lruzicki
Copy link
Contributor

Ticket:
https://openimis.atlassian.net/browse/CQI-149

Changes:

  • password validator is added
  • new reducer and actions are added to fetch password policy from backend
  • user master panel now validate password before saving (min. medium strength to save password)
  • recommendations uses translations (except the library recommendations)

How was it tested?

  1. Messages prioritize password policy set in the backend.
  2. If password policy is met then library validation enters, checking for additional changes, looking for typical words, password and dates.

Examples of use:

  1. Weak password - password policy errors
    Screenshot from 2024-05-15 18-01-22

  2. Password policy met but the password is still weak
    Screenshot from 2024-05-15 18-01-25

  3. Medium password, user can save the form, but it recommends him strengthening password (score 2 from library)
    Screenshot from 2024-05-15 18-01-34

  4. Strong password (score 3 from library)
    Screenshot from 2024-05-15 18-01-38

  5. Very strong password (score 4 from library)
    Screenshot from 2024-05-15 18-01-41

@@ -309,6 +328,9 @@ const UserMasterPanel = (props) => {
</InputAdornment>
}
/>
<Typography color={passwordScore >= 2 ? "primary" : "error"} className={classes.passwordFeedback}>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest you to create a variable which will explicitly say what do you check here. So instead of color={passwordScore >= 2 ? "primary" : "error"} I would declare a variable: const IS_PASSWORD_SECURED = passwordScore >= 2; and then use it like that: color={IS_PASSWORD_SECURED ? "primary" : "error"}. It will be more readable.

Copy link
Contributor

@olewandowski1 olewandowski1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left some comments. Please take a look on Sonar analysis, there is one code smell.

Copy link

sonarcloud bot commented May 22, 2024

Copy link
Contributor

@olewandowski1 olewandowski1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM @lruzicki . I'll merge it once BE will be merged. Let me know about it.

@lruzicki
Copy link
Contributor Author

lruzicki commented May 22, 2024

LGTM @lruzicki . I'll merge it once BE will be merged. Let me know about it.

@olewandowski1 BE is merged, you can merge FE.

@olewandowski1 olewandowski1 merged commit ad1897d into develop May 22, 2024
3 of 4 checks passed
@olewandowski1 olewandowski1 deleted the feature/CQI-149 branch May 22, 2024 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants