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

Password Validation issue #560

Closed
manojleaton opened this issue Mar 11, 2024 · 1 comment
Closed

Password Validation issue #560

manojleaton opened this issue Mar 11, 2024 · 1 comment
Labels
brightlayer-ui Used to identify Brightlayer UI platform issues for easy filtering bug Something not working as expected

Comments

@manojleaton
Copy link
Contributor

manojleaton commented Mar 11, 2024

Describe the bug / expected behavior

What are the steps to reproduce?

  1. Check the CreatePasswordScreen component.
  2. Verify areValidMatchingPasswords callback function. Not properly validating the entered password with PasswordRequirements.

Screenshots / Screen recording

Code snippet / Link to minimum reproduction example

const areValidMatchingPasswords = useCallback((): boolean => {
        if (PasswordProps?.passwordRequirements?.length === 0) {
            return confirmInput === passwordInput;
        }
        for (let i = 0; i < passwordRequirements.length; i++) {
            if (!new RegExp(passwordRequirements[i].regex).test(passwordInput)) return false;
        }
        return confirmInput === passwordInput;
    }, [PasswordProps?.passwordRequirements?.length, passwordRequirements, passwordInput, confirmInput]);

Your environment information

Suggested fix

Please refer RN-workflow's CreatePasswordScreen

Anything else to add?

@manojleaton manojleaton added bug Something not working as expected needs-review Issues that we would like to revisit/review brightlayer-ui Used to identify Brightlayer UI platform issues for easy filtering labels Mar 11, 2024
@manojleaton manojleaton changed the title Default PasswordRequirements not getting overridden by the passed PasswordRequirements Password Validation issue Mar 12, 2024
@surajeaton surajeaton removed the needs-review Issues that we would like to revisit/review label Mar 13, 2024
@manojleaton
Copy link
Contributor Author

manojleaton commented Apr 15, 2024

Issue is fixed, please refer this PR Password Validation issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
brightlayer-ui Used to identify Brightlayer UI platform issues for easy filtering bug Something not working as expected
Development

No branches or pull requests

2 participants