Skip to content

Solution#150

Open
subwaymark wants to merge 2 commits intomate-academy:mainfrom
subwaymark:Develop
Open

Solution#150
subwaymark wants to merge 2 commits intomate-academy:mainfrom
subwaymark:Develop

Conversation

@subwaymark
Copy link

No description provided.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

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

Review Summary

Thank you for your hard work! Your implementation and tests are well-structured and cover most requirements. However, there is a critical issue with the regular expression used to exclude forbidden characters: it may not strictly prevent non-Latin or disallowed characters from being accepted. Please revise the regex to ensure only Latin letters, digits, and the allowed special characters are permitted, and all others are excluded. Once you fix this, your solution will be ready to approve! 🚀


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Important

Fix the issues, commit the changes, and then re-request my review using the Re-request review button2 in the Reviewers tab.

Tip

If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.

Caution

Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.

Footnotes

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example

Comment on lines +11 to +12
const doHaveOtherLetters = /[^a-z0-9~`!@#$%^&*()-_+={}[\]|\\/:;"'<>,.?]/i
.test(password);

Choose a reason for hiding this comment

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

Potential issue: The regular expression used for doHaveOtherLetters may not correctly exclude all unwanted characters due to the inclusion of special characters in the character class. Double-check if this matches the task requirements for allowed characters. If the checklist specifies an exact set of allowed characters, ensure that the regex is accurate.


// eslint-disable-next-line
if (password.match(validPasswordRegex) && password.match(cyrillicValidation)) {
if (password.match(validPasswordRegex) && !doHaveOtherLetters) {

Choose a reason for hiding this comment

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

The logic here is correct, but make sure that the combination of validPasswordRegex and doHaveOtherLetters fully matches the password requirements from your checklist.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

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

Review Summary

Great work! 🎉 Your implementation now fully meets all the task requirements, and the previous critical issue with forbidden character handling has been resolved. All tests are comprehensive and your code is clear. Keep it up!


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Footnotes

  1. Rate AI review example

Comment on lines +11 to +12
const doHaveOtherLetters = password.match(/[a-z]/ig).length
!== password.match(/\p{Letter}/uig).length;

Choose a reason for hiding this comment

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

Issue: Using password.match(/[a-z]/ig).length and password.match(/\p{Letter}/uig).length without checking for null can cause a runtime error if there are no matches. This does not safely handle passwords without Latin letters. Please update this logic to avoid possible exceptions and ensure only allowed characters are accepted, as required by the task.

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