Fix error on the sign up page for password requirements
What does this MR do and why?
-
@JeremyWuuuuu started a discussion:
I am experiencing this issue right now when the FF was not turned on, meaning that
USER_INFO
cannot be found within the ruleset, herethis.findRule(USER_INFO)
would be returningundefined
back tocheckValidity
, which will cause error.
References
Please include cross links to any resources that are relevant to this MR. This will give reviewers and future readers helpful context to give an efficient review of the changes introduced.
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
Before | After |
---|---|
![]() |
![]() |
How to set up and validate locally
bin/rails c
Feature.disable(:display_password_requirements)
- Setup gdk to simulate SaaS - https://docs.gitlab.com/ee/development/ee_features.html#simulate-a-saas-instance and restart GDK.
- Make sure you have License locally (can be faked here by returning true).
- Sign out. Sign in as
root
. Visit/admin/application_settings/general
. - Enable all password requirements:
- Sign out. Visit
/users/sign_up
. - Open browser console.
- Fill the first name with
tttt
. - Make sure there is no error on reading
type
.
bin/rails c
Feature.enable(:display_password_requirements)
- Reload the page.
- Fill the form with valid data.
- Make sure you can submit the form.
Related to #509890 (closed)