Skip to content

Password verification done#735

Open
Chez10 wants to merge 1 commit intodevelopmentfrom
task2Kevin
Open

Password verification done#735
Chez10 wants to merge 1 commit intodevelopmentfrom
task2Kevin

Conversation

@Chez10
Copy link
Copy Markdown
Collaborator

@Chez10 Chez10 commented Jun 22, 2024

No description provided.

const isMedium = password.length >= 5 && [lowerCase, upperCase, number, symbol].filter(Boolean).length === 3 && !poorPasswords.includes(password);
const isHigh = password.length >= 5 && [lowerCase, upperCase, number, symbol].filter(Boolean).length === 4 && !poorPasswords.includes(password);

if (isPoor) return 0;
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

You dont need the ispoor check as you already have a default return 0.

alert(translate('passwordWeak'));
} else if (passwordStrength === 1) {
Alert.alert(
"Warning",
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

I suggest you use translate function for strings/text so that we can have 3 different languages.

const getPasswordStrengthColor = () => {
if (passwordStrength === 0) return 'pink';
if (passwordStrength === 1) return 'blue';
if (passwordStrength === 2) return '#298000';
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

It's good to not hardcode colors.

</View>

<View style={{ paddingTop: 20, paddingLeft: 15 }}>
<Text style={{ color: getPasswordStrengthColor(), fontSize: 20 }}>
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

nice, you dynamically change the values.

Copy link
Copy Markdown
Owner

@edumorlom edumorlom left a comment

Choose a reason for hiding this comment

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

Looks good, minor comments!

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